File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Disposing a Swing UI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Disposing a Swing UI" Watch "Disposing a Swing UI" New topic

Disposing a Swing UI

Ashish Chopra
Ranch Hand

Joined: Nov 30, 2004
Posts: 134

I have a JPanel that contains several other UI components placed on it, like JButtons, JLabels, some more JPanels etc.

When I have to dispose this parent JPanel, I am simply doing

Will this correctly dispose off the panel, with all its components? Or is there a possibility of a memory leak due to this?


Quis Custodiet Ipsos Custodes<br /> <br />My blog: <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Disposing a Swing UI
jQuery in Action, 3rd edition