Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Software Teaming: A Mob Programming, Whole-Team Approach
this week in the
Agile and Other Processes
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Rob Spoor
Junilu Lacar
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Piet Souris
Carey Brown
Bartenders:
Forum:
Swing / AWT / SWT
Removing Objects from a Custom Layout
Chris Baty
Ranch Hand
Posts: 30
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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: 22715
129
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
Rob Camick
Rancher
Posts: 3288
30
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
@Override
public void addLayoutComponent(Component arg0, Object arg1) {
// TODO Auto-generated method stub
}
Rob Spoor
Sheriff
Posts: 22715
129
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to Uncheck the checkbox
Dynamic Connection Pool
how to cast JSF SelectItem back to original type?
IFrame inside a window
Default value for body-content inside tld
More...