-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.2.0
-
generic
-
solaris_2.6
tushar.patel@West 1998-12-15
Here is a problem in JDK 1.2 latest revision.
The code:
class HelpMI extends MyMenuItem {
private JFrame mainFrame;
private HelpDialog helpDialog;
public HelpMI(String name, JFrame mainFrame, Font font) {
super(name, font);
this.mainFrame = mainFrame;
addActionListener( new HelpML());
}
class HelpML implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
helpDialog = new HelpDialog(mainFrame);
}
}
}
public class HelpDialog {
// Constants
private static final String TITLE = "Help";
public HelpDialog(JFrame parent) {
JOptionPane.showMessageDialog(parent, "Help is not implemented.",
TITLE, JOptionPane.PLAIN_MESSAGE);
}
}
causes the exception:
java.lang.ClassCastException: java.awt.AWTEventMulticaster
at
java.awt.Toolkit$ToolkitEventMulticaster.remove(Toolkit.java:1159)
at java.awt.Toolkit.removeAWTEventListener(Toolkit.java:1122)
at java.awt.LightweightDispatcher$2.run(Container.java:1847)
at java.security.AccessController.doPrivileged(Compiled Code)
at
java.awt.LightweightDispatcher.stopListeningForOtherDrags(Compiled Code)
at java.awt.LightweightDispatcher.trackMouseEnterExit(Compiled
Code)
at java.awt.LightweightDispatcher.processMouseEvent(Compiled
Code)
at java.awt.LightweightDispatcher.dispatchEvent(Compiled Code)
at java.awt.Container.dispatchEventImpl(Compiled Code)
at java.awt.Window.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventQueue.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
When the mouse is moved off the main parent frame, after the dialog was
created
a second time, the Exception occurs.
SunOS javamind 5.6 Generic_105181-05 sun4u sparc SUNW,Ultra-1-Engine
java full version "Solaris_JDK_1.2_01_dev05_fcsK"
- duplicates
-
JDK-4178589 ToolkitEventMulticaster must override AWTEventMulticaster.remove(EventListener)
- Closed