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??
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.