This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Removing Objects from a Custom Layout  RSS feed

 
Chris Baty
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
I created my own custom LayoutManager, which works okay. But now I want to remove a button when it's been clicked. Has anyone ever implemented removeLayoutComponent(Component)? I'm just looking for an example.
Thanks.
Chris
 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you need to do is undo all you've done in addLayoutComponent. So how about you show us that method?
 
Rob Camick
Ranch Hand
Posts: 2754
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look in the Java source code that comes with the JDK. I believe the file name is src.zip, so just unzip it and you have access to all the classes.
 
Chris Baty
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

@Override
public void addLayoutComponent(Component arg0, Object arg1) {
// TODO Auto-generated method stub

}
 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your layout manager doesn't have any of its own administration then it's not necessary to do any cleanup. Just keep the method empty.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!