cardell
asked on
Changing components in containers
I'm trying to add new elements to a frame, and get rid of the other elements that were there. For instance an applet where I add(new Label("Hello")) ... now I want "Hello" to disappear and I want to add(new Label("Goodbye").
I thought that either clearAll() or some use of repaint() would do it, but I can't get it to clear and then add components. I can't find any examples of doing this in my books....can anyone help me??
I thought that either clearAll() or some use of repaint() would do it, but I can't get it to clear and then add components. I can't find any examples of doing this in my books....can anyone help me??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For Instance:
myLabelHi.show(false);
myLabelBye.show(true);
Its a bit messy when you have a lot of components but it soleves all sorts of programming problems.