When I start my applet with appletviewer, I get a white window saying "Hello". When I make my applet window bigger, I get a blue/grey window that is blank. When I make my applet window smaller, I get a blue/grey window that says "Hello".
What is the reason for this strange behaviour? I simply want "Hello" to be always positioned in the middle of the screen.
Do read the link above, but I'll summarize by saying that in Swing (dealing with any component whose name starts with a J) you never override paint(Graphics) but rather only paintComponent(Graphics), and even then, always call super.paintComponent(). Overriding "paint()" on a JApplet makes all kinds of bad things happen!