-
Bug
-
Resolution: Fixed
-
P3
-
2.0.1, 1.1.5, 1.1.6, 1.1.7, 1.2.0, 1.2.1
-
1.2.2
-
generic, x86, sparc
-
generic, solaris_2.5.1, solaris_2.6, solaris_8, windows_nt
Name: jtC48319 Date: 06/08/98
I was finally able to isolate two errors I filed
previous bug reports on but couldn't isolate then.
When I run this application in the foreground:
import java.awt.*;
import java.awt.event.*;
import java.awt.swing.*;
public class BugFrame extends JFrame implements ActionListener
{
private JMenuItem quitButton;
public static void main(String args[])
{
BugFrame test = new BugFrame();
test.show();
}
public BugFrame()
{
JMenuBar mBar = new JMenuBar();
setJMenuBar( mBar );
JMenu fileMenu = new JMenu( "File" );
mBar.add( fileMenu );
quitButton = new JMenuItem( "Close" );
fileMenu.add( quitButton );
quitButton.addActionListener(this);
JPanel p = new JPanel();
p.setPreferredSize(new Dimension(100, 100));
getContentPane().add(p);
pack();
}
public void actionPerformed(ActionEvent ev)
{
Object obj = ev.getSource();
if (obj == quitButton) {
setVisible(false);
}
}
}
and press the "Close" menu entry, the window closes
and this error message is generated:
Received a mouse event from a non-showing Component java.awt.swing.JMenu[,0,1,45x19,layout=java.awt.swing.OverlayLayout, JMenu]
Received a mouse event from a non-showing Component java.awt.swing.JMenu[,0,1,45x19,layout=java.awt.swing.OverlayLayout, JMenu]
(You'll have to kill the process since it doesn't
exit on close).
The same error is generated if you dispose of the
window instead of setting visibility to false.
If I instead run this in the background, the
application hangs with the window still showing
and when I hit return in the xterm it was invoked
from, I get this:
2] + Suspended (tty output) /local/applications/Java/INSTALLED/jdk1.2beta3/bin/java BugFrame
I then have to kill the java process.
(Review ID: 33174)
======================================================================
- duplicates
-
JDK-4203160 invoking item within popup menu gives error stderr message
- Closed
-
JDK-4133322 JMenu reports an error when switching to different window
- Closed
-
JDK-4195811 In Swing, Receiving a mouse event from a non-showing Component
- Closed