This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring 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="" target="_blank" rel="nofollow"></a>
subject: Disposing a Swing UI
jQuery in Action, 3rd edition