Hey gang, great site eh? I'm trying to change the content of a panel, depending on the user's choices throughout their stay in my applet.
Is there a way to add/remove buttons, jtables, and lists in a panel after the panel has been initialized? So far I can remove but not add... thanks for any help. Please email me. Bart
I've removed and added stuff in applets. But I'm not using Swing, just the AWT. That shouldn't make a difference. If you are using a layout manager, you might need to force the layout manager to reshuffle stuff.
Originally posted by Paul Wheaton: I've removed and added stuff in applets. But I'm not using Swing, just the AWT. That shouldn't make a difference. If you are using a layout manager, you might need to force the layout manager to reshuffle stuff.
So if I have:
Panel panel; Button button; later on in the code... Panel.add(button); Panel.remove(button); These should both work with a Panel.repaint(); ??
In any container, if u r removing or adding some thing, it's the Layout Manager which does all arrangement. So if u call panel.validate() method after adding or removing any component from panel then it will call layout manager to draw components again.
Post by:autobot
Hang a left on main. Then read this tiny ad:
a bit of art, as a gift, the permaculture playing cards