diff --git a/jdk/src/windows/native/sun/windows/awt_Choice.cpp b/jdk/src/windows/native/sun/windows/awt_Choice.cpp index 8c1621afec6..e8296d4c514 100644 --- a/jdk/src/windows/native/sun/windows/awt_Choice.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Choice.cpp @@ -86,6 +86,7 @@ static const UINT MINIMUM_NUMBER_OF_VISIBLE_ITEMS = 8; AwtChoice::AwtChoice() { m_hList = NULL; m_listDefWindowProc = NULL; + m_selectedItem = -1; } LPCTSTR AwtChoice::GetClassName() { @@ -437,9 +438,10 @@ LRESULT CALLBACK AwtChoice::ListWindowProc(HWND hwnd, UINT message, MsgRouting AwtChoice::WmNotify(UINT notifyCode) { if (notifyCode == CBN_SELCHANGE) { - int itemSelect = (int)SendMessage(CB_GETCURSEL); - if (itemSelect != CB_ERR){ - DoCallback("handleAction", "(I)V", itemSelect); + int selectedItem = (int)SendMessage(CB_GETCURSEL); + if (selectedItem != CB_ERR && m_selectedItem != selectedItem){ + m_selectedItem = selectedItem; + DoCallback("handleAction", "(I)V", selectedItem); } } else if (notifyCode == CBN_DROPDOWN) { diff --git a/jdk/src/windows/native/sun/windows/awt_Choice.h b/jdk/src/windows/native/sun/windows/awt_Choice.h index 4852301bb3d..ad0a21d23ae 100644 --- a/jdk/src/windows/native/sun/windows/awt_Choice.h +++ b/jdk/src/windows/native/sun/windows/awt_Choice.h @@ -94,6 +94,7 @@ private: static BOOL sm_isMouseMoveInList; HWND m_hList; WNDPROC m_listDefWindowProc; + int m_selectedItem; static LRESULT CALLBACK ListWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); };