I have an applet that contains JTextFields, JButtons, JLabels, etc. When one of the buttons is pressed I use removeAll() to clear the applet so I can add different components to the screen. The problem is that the applet does not refresh. Everything clears, but the new components do not show up until the appletviewer screen is resized, or the an event happens in the browser window. For example, if I were to print the page, then it would refreh. Is there a way to refresh this without resizing the window? Thanks.
I think invoking validate() on the container will check if the layout is valid and cause everything to be laid out and repainted if necessary. If you are presenting several screens to the user it will be easier to use java.awt.CardLayout to set up the screens ahead of time and flip through them.