Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JDialog

Status
Not open for further replies.

drkestrel

MIS
Sep 25, 2000
439
GB
I am using JDialog box, which is spawned off from a parent Frame.

When the user closes the JDialog, am I meant to do anything other than to call hide() on the JDialog() in order to release any resources for the Dialog??

If so, what am I meant to do?
 
Call dispose();
You also need to do
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
in case the user closes the dialog with the X button.
Usually in a constructor or int method.
 
Here's a bit of trivia for you. My work with OptimizeIt revealed that if you mix AWT and swing components on a JDialog, the AWT component listeners hold a reference back to the JDialog object. The result is that the entire JDialog and all it's components are never garbage-collected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top