-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.3.0
-
x86, sparc
-
solaris_2.6, windows_nt
JDK1.3-F : Alt+mnemonic in JMenu causes exceptions to be thrown. To see the problem, run the sample code below. The problem is seen on both Solaris and Windows NT
1. Press Alt+0 -- This cuases exceptions to be thrown. Exceptions are given below,
-- Sample Code --
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class T extends JFrame {
public T() {
JMenu jmenu;
JRadioButtonMenuItem jmenuitem;
JMenuBar jmenubar = new JMenuBar();
for(int i = 0; i < 2; i ++) {
jmenu = new JMenu("JMenu" + i);
jmenu.setMnemonic('0' + i);
jmenubar.add(jmenu);
for(int j = 0; j < 5; j ++) {
jmenuitem = new JRadioButtonMenuItem("JRadioButtonMenuItem" + i + j);
jmenuitem.setMnemonic('0' + j);
jmenuitem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("ActionPerformed");
}
});
jmenu.add(jmenuitem);
}
}
getContentPane().add(jmenubar);
pack();
show();
}
public static void main(String argv[]) {
new T();
}
}
-- Sample Code --
-- Exceptions --
lang.Exception: Stack trace
at java.lang.Thread.dumpStack(..\..\..\..\..\..\src\share\classes\java\lang\Thread.java:983)
at javax.swing.plaf.basic.BasicMenuUI$PostAction.actionPerformed(..\..\..\..\..\src\share\classes\javax\swing\plaf\basic\BasicMenuUI.java:222)
at javax.swing.SwingUtilities.notifyAction(..\..\javax\swing\1.2_src\javax\swing\SwingUtilities.java:1561)
at javax.swing.JComponent.processKeyBinding(..\..\javax\swing\1.2_src\javax\swing\JComponent.java:1840)
at javax.swing.KeyboardManager.fireBinding(..\..\..\..\src\share\classes\javax\swing\KeyboardManager.java:267)
at javax.swing.KeyboardManager.fireKeyboardAction(..\..\..\..\src\share\classes\javax\swing\KeyboardManager.java:209)
at javax.swing.JComponent.processKeyBindingsForAllComponents(..\..\javax\swing\1.2_src\javax\swing\JComponent.java:1898)
at javax.swing.JComponent.processKeyBindings(..\..\javax\swing\1.2_src\javax\swing\JComponent.java:1891)
at javax.swing.JComponent.processKeyEvent(..\..\javax\swing\1.2_src\javax\swing\JComponent.java:1803)
at java.awt.Component.processEvent(..\..\..\..\src\share\classes\java\awt\Component.java:3008)
at java.awt.Container.processEvent(..\..\..\..\src\share\classes\java\awt\Container.java:990)
at java.awt.Component.dispatchEventImpl(..\..\..\..\src\share\classes\java\awt\Component.java:2394)
at java.awt.Container.dispatchEventImpl(..\..\..\..\src\share\classes\java\awt\Container.java:1035)
at java.awt.Component.dispatchEvent(..\..\..\..\src\share\classes\java\awt\Component.java:2307)
at java.awt.LightweightDispatcher.processKeyEvent(..\..\..\..\src\share\classes\java\awt\Container.java:1766)
at java.awt.LightweightDispatcher.dispatchEvent(..\..\..\..\src\share\classes\java\awt\Container.java:1740)
at java.awt.Container.dispatchEventImpl(..\..\..\..\src\share\classes\java\awt\Container.java:1022)
at java.awt.Window.dispatchEventImpl(..\..\..\..\src\share\classes\java\awt\Window.java:749)
at java.awt.Component.dispatchEvent(..\..\..\..\src\share\classes\java\awt\Component.java:2307)
at java.awt.EventQueue.dispatchEvent(..\..\..\..\src\share\classes\java\awt\EventQueue.java:287)
at java.awt.EventDispatchThread.pumpOneEvent(..\..\..\..\src\share\classes\java\awt\EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(..\..\..\..\src\share\classes\java\awt\EventDispatchThread.java:95)
at java.awt.EventDispatchThread.run(..\..\..\..\src\share\classes\java\awt\EventDispatchThread.java:86)
-- Exceptions --
1. Press Alt+0 -- This cuases exceptions to be thrown. Exceptions are given below,
-- Sample Code --
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class T extends JFrame {
public T() {
JMenu jmenu;
JRadioButtonMenuItem jmenuitem;
JMenuBar jmenubar = new JMenuBar();
for(int i = 0; i < 2; i ++) {
jmenu = new JMenu("JMenu" + i);
jmenu.setMnemonic('0' + i);
jmenubar.add(jmenu);
for(int j = 0; j < 5; j ++) {
jmenuitem = new JRadioButtonMenuItem("JRadioButtonMenuItem" + i + j);
jmenuitem.setMnemonic('0' + j);
jmenuitem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("ActionPerformed");
}
});
jmenu.add(jmenuitem);
}
}
getContentPane().add(jmenubar);
pack();
show();
}
public static void main(String argv[]) {
new T();
}
}
-- Sample Code --
-- Exceptions --
lang.Exception: Stack trace
at java.lang.Thread.dumpStack(..\..\..\..\..\..\src\share\classes\java\lang\Thread.java:983)
at javax.swing.plaf.basic.BasicMenuUI$PostAction.actionPerformed(..\..\..\..\..\src\share\classes\javax\swing\plaf\basic\BasicMenuUI.java:222)
at javax.swing.SwingUtilities.notifyAction(..\..\javax\swing\1.2_src\javax\swing\SwingUtilities.java:1561)
at javax.swing.JComponent.processKeyBinding(..\..\javax\swing\1.2_src\javax\swing\JComponent.java:1840)
at javax.swing.KeyboardManager.fireBinding(..\..\..\..\src\share\classes\javax\swing\KeyboardManager.java:267)
at javax.swing.KeyboardManager.fireKeyboardAction(..\..\..\..\src\share\classes\javax\swing\KeyboardManager.java:209)
at javax.swing.JComponent.processKeyBindingsForAllComponents(..\..\javax\swing\1.2_src\javax\swing\JComponent.java:1898)
at javax.swing.JComponent.processKeyBindings(..\..\javax\swing\1.2_src\javax\swing\JComponent.java:1891)
at javax.swing.JComponent.processKeyEvent(..\..\javax\swing\1.2_src\javax\swing\JComponent.java:1803)
at java.awt.Component.processEvent(..\..\..\..\src\share\classes\java\awt\Component.java:3008)
at java.awt.Container.processEvent(..\..\..\..\src\share\classes\java\awt\Container.java:990)
at java.awt.Component.dispatchEventImpl(..\..\..\..\src\share\classes\java\awt\Component.java:2394)
at java.awt.Container.dispatchEventImpl(..\..\..\..\src\share\classes\java\awt\Container.java:1035)
at java.awt.Component.dispatchEvent(..\..\..\..\src\share\classes\java\awt\Component.java:2307)
at java.awt.LightweightDispatcher.processKeyEvent(..\..\..\..\src\share\classes\java\awt\Container.java:1766)
at java.awt.LightweightDispatcher.dispatchEvent(..\..\..\..\src\share\classes\java\awt\Container.java:1740)
at java.awt.Container.dispatchEventImpl(..\..\..\..\src\share\classes\java\awt\Container.java:1022)
at java.awt.Window.dispatchEventImpl(..\..\..\..\src\share\classes\java\awt\Window.java:749)
at java.awt.Component.dispatchEvent(..\..\..\..\src\share\classes\java\awt\Component.java:2307)
at java.awt.EventQueue.dispatchEvent(..\..\..\..\src\share\classes\java\awt\EventQueue.java:287)
at java.awt.EventDispatchThread.pumpOneEvent(..\..\..\..\src\share\classes\java\awt\EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(..\..\..\..\src\share\classes\java\awt\EventDispatchThread.java:95)
at java.awt.EventDispatchThread.run(..\..\..\..\src\share\classes\java\awt\EventDispatchThread.java:86)
-- Exceptions --
- duplicates
-
JDK-4243058 swing.plaf.basic.BasicMenuUI$PostAction exception traversing menu in jmol-0.2
-
- Closed
-
-
JDK-4242399 Sense of boolean constant is reversed in if-then within inner class
-
- Closed
-