JDK-6646781 : Nimbus L&F : Menu stays open when continously clicked on internal frame icon on Windows & nimbus L&F
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2008-01-03
  • Updated: 2011-02-16
  • Resolved: 2008-06-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u10 b26Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
I have a frame which is having a internal frame. When i click on the icon of the internal frame Menu is displayed. When i continously click on the icon. I would expect the menu to close & open . But right now its not happening on windows & nimbus LookAndFeel. but in GTKLookAndFeel the menu opens & closes for every click. As nimbus LookAndFeel is a cross platform lookAndFeel i would expect the behaviour to be same. 

Step to reproduce:-
---------------------
1) Run the attached testcases.
2) Click on the icon of the internal frame continously . If you menu stays as it is with out closing & opening, then the bug is reproduced. 

This is reproduced in all the nimbus build.

Comments
SUGGESTED FIX The solution is simple. For look and feels where the problem appears, the "PopupMenu.consumeEventOnClose" property should be set to TRUE.
17-01-2008

EVALUATION The problem is described in 4912806. It solved for some look and feels. The following code in BasicPopupMenuUI.MouseGrabber.eventDispatched() is devoted to solve the problem: 847 // Ask UIManager about should we consume event that closes 848 // popup. This made to match native apps behaviour. 849 boolean consumeEvent = 850 UIManager.getBoolean("PopupMenu.consumeEventOnClose"); 851 // Consume the event so that normal processing stops. 852 if(consumeEvent && !(src instanceof MenuElement)) { 853 ((MouseEvent)ev).consume(); 854 } The solution is simple. For look and feels where the problem appears, the "PopupMenu.consumeEventOnClose" property should be set to TRUE.
17-01-2008

EVALUATION This bug is easily reproduced with SwingSet2 run SwingSet2 set WindowsLaF click the InternalFrame icon -> see popup shown click it again -> popup is still shown (if you click the frames title is will close the popup) It works correctly with Motif Laf (GTL Laf should be checked) Rather then assigning it to Nimbus or Windows Laf owner I assign it to the JInternalFrame owner because it will be easier to solve this problem for all Lafs at once
09-01-2008