aspose file tools*
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 Spring in Action this week in the Spring 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
Author

Getting a null frame (Event dispatching problem?)

Shaun Fernandes
Greenhorn

Joined: Nov 20, 2001
Posts: 1
Hi,
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 JFrame..like 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
Hi,
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.
Regards,
Manfred.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Getting a null frame (Event dispatching problem?)