The moose likes Swing / AWT / SWT and the fly likes Getting a null frame (Event dispatching problem?) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Getting a null frame (Event dispatching problem?)" Watch "Getting a null frame (Event dispatching problem?)" New topic

Getting a null frame (Event dispatching problem?)

Shaun Fernandes

Joined: Nov 20, 2001
Posts: 1
I have a JFrame, which launches a JDialog from its constructor.
The JDialog posts back an event to this parent frame when some button on the dialog (say Cancel) is pressed, thereby disposing the JDialog and the event is captured in the JFrame's overridden processEvent() method, where I call the rest of the initialization routine for the laying out the components in the frame and finally showing it. The problem is, when the JDialog is CLOSED (by clicking the "X" on the top right corner), I get a NULL parent frame located at (0,0). What could be going wrong?
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Without seeing any code it is hard to say. Make sure that you have a WindowListener for your JDialog to catch the X button being used to close the JDialog.
I agree. Here's the link:
subject: Getting a null frame (Event dispatching problem?)
It's not a secret anymore!