//SecondApplet.java import javax.swing.*; //JApplet, JOptionPane classes import java.awt.*; //allows drawing: Graphics, Color, Font classes public class SecondApplet extends JApplet { public void paint (Graphics g) { //set the drawing color. //white, black, red, blue, green, cyan, magenta, yellow, pink, orange, gray, light_gray, dark_gray g.setColor( Color.CYAN ); //filled oval g.fillOval(100, 100, 400, 400); g.setColor( Color.BLACK ); g.drawLine(0, 0, 600, 600); g.drawLine(600, 0, 0, 600); g.drawRect(100, 100, 400, 400); g.setColor( Color.GREEN ); g.fillRect(150, 250, 300, 100); g.fillRect(250, 150, 100, 300); g.fillOval(250, 0, 100, 100); g.fillOval(0, 250, 100, 100); g.fillOval(500, 250, 100, 100); g.fillOval(250, 500, 100, 100); g.setColor( Color.RED ); g.setFont( new Font( "Serif", Font.BOLD, 16 ) ); //("fontname",atttributes,size) g.drawString("Second Applet!",260,50); //example of getWidth() and getHeight() //10x10 red square 3/4 across, 1/4 down //run this in appletviewer and resize the window to see the effect g.fillRect( getWidth()/4*3, getHeight()/4, 10,10); } } //paste variables and assignment from IntVariable, display