wood burning stoves 2.0
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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="http://www.coherentrambling.blogspot.com" target="_blank" rel="nofollow">http://www.coherentrambling.blogspot.com</a>
I agree. Here's the link: http://aspose.com/file-tools
subject: Disposing a Swing UI
It's not a secret anymore!