// 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 Squareerrors extends Applet // this is the applet
{
public void paint(Graphics g) // this does the drawing
{
g.setColor(Color.red); // set the drawing pen colour
g.fillrect(100, 100, 100, 100); // draw a filled square
g.drawString("One red square", 100, 220); // write the string
}
}
|