Learning Applets

OK lovers, so I’m learning applets in java as you can see my problem is when i run this app it works but the “background” wont turn the color its set as unless you move the applet. any ideas?

[code]import javax.swing.;
import java.util.
;
import java.awt.*;
public class helloapplet extends JApplet {
@Override
public void paint(Graphics g) {
int x = 10;
int y = 10;
setBackground(Color.black);
g.setColor(Color.red);
g.drawString(“Hello World”, x, y);

}

}

[/code]

___Merged doublepost__________________

setSize(500,500);

^^; Can be closed if wished.

You will need to have a loop, which calls the draw method and then waits to a certain fps.

Within this same loop you will also check for key presses etc… if needed.