I want to know how to make visible components added to a JPanel that happens to be inside a JScrollPane after the JFrame has already been created. My class, that extends JFrame, has the jbInit() method you see below. At the very end of the jbInit() method I set up cardPanel to a GridLayout of 10 rows 1 column. This is so that I can display up to 10 distinct components as I add them dynamically using the displayResults() method. As you can imagine, the new HandStats (which extend JPanel) if they are being added to cardPanel, are not being displayed. I've tried using repaint() methods but they don't do anything. How do I accomplish this? Also, how do I remove the HandStats objects from cardPanel so that I can display another new set of them?
Well, I guess I should tell you how to execute it.
Run it, and it will start with a handful of components on a Panel. In the File Menu up top, there is an "Add" option that will add a handful of additional components to that panel. [ November 02, 2004: Message edited by: jefff willis ]
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss