import java.awt.*; // make of existing graphics code
import java.applet.*; // make of existing applet code
// Create an applet and draw a small circle on
// the screen.
public class circle3 extends Applet // this is the applet
{
public void paint(Graphics g) // this does the drawing
{
g.setColor(Color.blue); // set the drawing pen to blue
g.fillOval(0, 0, 60, 60); // draw the filled circle
g.drawString("One blue circle", 0, 80); //write the string
g.setColor(Color.red); // set the drawing pen to red
g.fillOval(120, 120, 60, 60); // draw the filled circle
g.drawString("One red circle", 110, 200); //write the string
}
}
|