-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.2_05
-
generic
-
generic
This program first registeres itself as an AWTEventListener and starts
another Java program (e.g. SwingSet2 demo) passed as a command line
argument. It then displays message as new windows are opened/closed. It
also display the name of the menu item and it's ancestor window when
user clicks on a menu item.
The following procedure will help us notice this behaviour:
a) Compile and run this program with the standard
"SwingSet2 demo as follows:
c:\>java -classpath ".;%JAVA_HOME%\demo\jfc\SwingSet2\swingSet2.jar"
DumpWindow SwingSet2
b) Click on "Themes" (Do not select any of the selection just yet).
You will see that the program print "Menu: JMenu" and "Window:
JFrame".
c) Select any one of the themes, say Aqua.
The program will print "Menu:JRadioButtonMenuItem" and "Window:
JFrame".
d) Now select "File --> About" and click "OK"
e) Go back to Themes (again do not select any option, just click and
hold the mouse on "Themes")
The program will print "Menu: JMenu" and "Window: JFrame"
**Interestingly** this time, we will see the following event:
********
java.awt.event.WindowEvent[WINDOW_OPENED,opposite=null,oldState=0,newState=0] on
###overrideRedirect###
javax.swing.Popup$HeavyWeightWindow[###overrideRedirect###,213,104,117x152,la
yout=java.awt.BorderLayout,rootPaneCheckingEnabled=true]
******
which we did NOT see earlier at step b.
f) Now select any theme, say "Default", now, you will see the program
will print "Menu: JRadioButtonMenuItem" and "Window:
Popup$HeavyWeightWindow"
*NOTE* At step f), the ancestor for "JRadioButtonMenuItem" has CHANGED
from "JFrame" in step c) to "Popup$HeavyWeightWindow" is step f).
---
another Java program (e.g. SwingSet2 demo) passed as a command line
argument. It then displays message as new windows are opened/closed. It
also display the name of the menu item and it's ancestor window when
user clicks on a menu item.
The following procedure will help us notice this behaviour:
a) Compile and run this program with the standard
"SwingSet2 demo as follows:
c:\>java -classpath ".;%JAVA_HOME%\demo\jfc\SwingSet2\swingSet2.jar"
DumpWindow SwingSet2
b) Click on "Themes" (Do not select any of the selection just yet).
You will see that the program print "Menu: JMenu" and "Window:
JFrame".
c) Select any one of the themes, say Aqua.
The program will print "Menu:JRadioButtonMenuItem" and "Window:
JFrame".
d) Now select "File --> About" and click "OK"
e) Go back to Themes (again do not select any option, just click and
hold the mouse on "Themes")
The program will print "Menu: JMenu" and "Window: JFrame"
**Interestingly** this time, we will see the following event:
********
java.awt.event.WindowEvent[WINDOW_OPENED,opposite=null,oldState=0,newState=0] on
###overrideRedirect###
javax.swing.Popup$HeavyWeightWindow[###overrideRedirect###,213,104,117x152,la
yout=java.awt.BorderLayout,rootPaneCheckingEnabled=true]
******
which we did NOT see earlier at step b.
f) Now select any theme, say "Default", now, you will see the program
will print "Menu: JRadioButtonMenuItem" and "Window:
Popup$HeavyWeightWindow"
*NOTE* At step f), the ancestor for "JRadioButtonMenuItem" has CHANGED
from "JFrame" in step c) to "Popup$HeavyWeightWindow" is step f).
---
- duplicates
-
JDK-4791569 Accelerator keys don't work when JPopupMenu is outside its parent
- Resolved