Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

remove method

 
memati bas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Would anyone please explain how to use remove method ??
For example what sholud I use in its parameters ?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The remove method of what class?
 
memati bas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPanel class
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two different ones; the more useful one takes the Component to be removed as an argument. So if there's a JButton in a JPanel, and you want to remove it, just call "panel.remove(button)".

After removing components from a panel that's already visible on screen, you must call "validate()" on the panel to get it to fix up the layout.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic