I am having a problem with repainting a panel. I have a main panel, and I add other panels onto it. Depending on which selection a user chooses for how many other panels they want added to it, I need to repaint the main panel with the correct number of panels added to it. I have a Choice component, and they select which number of panels to add, then I have a button which gets the selected number of panels to add, and clears the main panel with mainpanel.removeAll() (from Container), and then I add the new amount of panels. It works fine except I don't see the new panel unless I resize the frame or applet first. What is the problem and how can I correct it?