File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Android Security Essentials Live Lessons this week in the Android 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.
 
jQuery in Action, 2nd edition
 
subject: Getting a null frame (Event dispatching problem?)
 
Similar Threads
JDialog with JApplet parent
fix JDialog position relative to its parent JFrame component
Opening a frame from a dialog
problem with closing JDialog created with JFrame
JDialog Question