I have an applet that displays two screens and a button is used to transfer between them. The way I need to do it (it's a course project) is to remove all the previous objects using removeAll, create the relevant objects for the new panel and then use repaint to display everything.
The trouble is, when I press the button, nothing seems to happen until I move my mouse, then everything disappears and the only way I can get the new panel to display is to click somewhere on the applet window's border. Then everything in the new panel displays perfectly.
So does anyone know of a way to make the applet display the new panel on it's own without any input from me?
The relevant code I'm using is: