I have an internal Frame that has several TextFields and CheckBoxes, and I would like to be able to clear all the data with the push of a button. Is there anyway to do that without removing and then adding each component?
So, if I understand, which I rarely do at first. If I have a checkbox called: GenderCheck, RaceCheck, etc, I can clear all those with one validate() method on the container? What if my container is a JTabbedPane? I can't seem to get it to work. I have JTabbedPane topPane = new JTabbedPane() Then when I click a button I have topPane.validate() Is that right or wrong?
That should work, I just tried it with a JPanel and a JFrame and both times it repainted the screen correctly. I'll try it with a JTabbedPane and let you know.
Thanks, I would appreciate it. I have had some problems with JTabbedPanes repainting correctly on some other functions as well. And the same functions worked with a JFrame. So it must be something in the JTabbedPane. But thanks for your help and let me know.
Try this: On any Jcomponent(e.g. your JTabbedPane): myJTabbedPane.getTopLevelAncestor().validate() Ensure via System.out.println that the getTopMostAncestor() returns your top level JFrame(As a sanity check). This should redraw the entire app frame and your TabbedPane.
Post by:autobot
Get off me! Here, read this tiny ad:
a bit of art, as a gift, the permaculture playing cards