1import java.awt.Color;
2import java.awt.Graphics;
3
4import javax.swing.JApplet;
5
6public class SwingHelloWorld extends JApplet {
7
8 public void paint(Graphics g) {
9 setBackground( Color.red );
10 setForeground( Color.yellow );
11 super.paint(g);
12 g.drawString( "Hello World!", 50, 50 );
13 }
14}