Weird window close behavior
- From: mrstephengross <mrstevegross@xxxxxxxxx>
- Date: Thu, 26 Jun 2008 12:27:16 -0700 (PDT)
I have a short swing program (see below) that dislpays a HelloWorld
frame. It compiles fine, but runtime behavior is a bit awkward. To
wit:
(1) I run the program. It shows a nice 100x100 empty panel. I move the
mouse directly over the CLOSE button (the top-right "X") WITHOUT
moving over the content pane at all. I click the close button. The
window closes.
(2) I run the program. It shows a nice 100x100 empty panel. I move the
mouse first over the content pane, THEN over the CLOSE button and
click it. The window does NOT close.
This is indeed weird behavior. I wonder if it has anything to do with
my system configuration. I am running:
OS: Ubuntu 6
Javac: gcj-4.2 (GCC) 4.3.2 (Ubuntu 4.2.3-2ubuntu6)
java: "1.5.0" gij (GNU libgcj) version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)
Any ideas?
=== CODE FOLLOWS ===
import javax.swing.JFrame;
public class HelloWorldFrame {
public static void main(String args[]) {
new HelloWorldFrame();
}
HelloWorldFrame() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(100, 100);
frame.setVisible(true);
}
}
=== EOF ===
.
- Follow-Ups:
- Re: Weird window close behavior
- From: Roedy Green
- Re: Weird window close behavior
- From: Daniel Pitts
- Re: Weird window close behavior
- From: mrstephengross
- Re: Weird window close behavior
- Prev by Date: Re: cobbling a ComboBox
- Next by Date: Re: Weird window close behavior
- Previous by thread: Transparent JDesktopPane with intransparent JInternalFrames?
- Next by thread: Re: Weird window close behavior
- Index(es):