An Applet Using the paint() Method to Draw a String - Java Applet

Java examples for Applet:Applet Creation

Description

An Applet Using the paint() Method to Draw a String

Demo Code

import javax.swing.JApplet;
import java.awt.Graphics;

public class Main extends JApplet {
        @Override//from   www .j  a  v  a2  s.  com
        public void paint(Graphics g) {
                super.paint(g);
                g.drawString("Hello Applet!", 10, 20 );
        }
}

Related Tutorials