aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JPanel like JDialog 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 "JPanel like JDialog" Watch "JPanel like JDialog" New topic
Author

JPanel like JDialog

alejandro garcia
Greenhorn

Joined: Aug 11, 2007
Posts: 10
Hello, in this code suppose that the dlg is defined in one case as a JDialog, I run it and it seems that the JDialog is executed AFTER closing it, so the message is printed after closing the JDialog.
But when I run the code with dlg defined as JPanel it prints the message before I close the JPanel.

And I need the JPanel to behave like the JDialog in that sense.. how could I deal with this?
Thanks in advance




Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2312
    
  49
I run it and it seems that the JDialog is executed AFTER closing it, so the message is printed after closing the JDialog.
I would imagine that what is happening is your JDialog is modal so it is effectively blocking the current thread when it is displayed. Once you close the dialog the method's execution continues so prints out "I'm Here".

I don't understand what you mean by closing a panel because you can't close a JPanel in the same way as a JDialog or JFrame, how are you closing it?

BTW Before attempting to perform your own block be careful because if you just block the event thread your GUI will lock up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPanel like JDialog