wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Removing Objects from a Custom Layout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Removing Objects from a Custom Layout" Watch "Removing Objects from a Custom Layout" New topic
Author

Removing Objects from a Custom Layout

Chris Baty
Ranch Hand

Joined: Nov 23, 2008
Posts: 30
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

Joined: Oct 27, 2005
Posts: 19651
    
  18

All you need to do is undo all you've done in addLayoutComponent. So how about you show us that method?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2153
    
    7
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

Joined: Nov 23, 2008
Posts: 30

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

}
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Removing Objects from a Custom Layout
 
Similar Threads
how to cast JSF SelectItem back to original type?
Dynamic Connection Pool
How to Uncheck the checkbox
IFrame inside a window
Default value for body-content inside tld