This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I drop an object?  RSS feed

 
Charles Mulloy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm about to write a program that adds and removes tabs from a tabbed pane. But I'm not so sure of the mechanics behind the remove() method. The addTab() method requires a component. So far I've only used JPanels. If I use the remove() method and target a panel, will it just drop it from the TabbedPane but stay in memory or will it drop the panel along with everything in the panel? I'm not sure it matters, but what I usually do, for organization's sake, to create JPanels is I use a single method to construct the panel and then return it like this:

If that doesn't work how can I drop an object? I'm asking this because I don't want my application to eat anymore memory that it has to.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!