<Swing Dev> [10] RFR JDK-8075063:Context menu closes on mouse scroll

Semyon Sadetsky semyon.sadetsky at oracle.com
Wed Jun 14 14:56:37 UTC 2017


Hi Prasanta,

I may be wrong, but it seems to me that the standard behavior is when 
any wheel event cannot close popups.

--Semyon


On 06/13/2017 10:39 PM, Prasanta Sadhukhan wrote:
> Hi All,
>
> Please review a fix for an issue whereby it is seen
> hitting the scroll wheel by accident closes whole structure of context 
> menus causing it to disappear and the user has to invoke the menu again.
>
> Issue was popupMenu is getting closed for mouse wheel rotation if the 
> menu is not from JComboBox.
> If the context menu is opened from JMenuItem, JMenu then if the mouse 
> wheel is rotated anywhere in frame, then it calls cancelPopupMenu() 
> causing it to call setVisible(false) and so menu disappears.
>
> Proposed fix is to check if the mouse wheel rotation is done in JMenu, 
> JMenuItem or anywhere in frame, then if popup is present, then do not 
> close the popupmenu.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8075063
> webrev: http://cr.openjdk.java.net/~psadhukhan/8075063/webrev.00/
>
> Regards
> Prasanta
>




More information about the swing-dev mailing list