/* Author : Robert Magala */ /* Assignment : 3.18 */ /* Due Date : September 2003 */ /* Platform : Java 1.41 */ /* Summary : Applet 5, draw oval */ import java.awt.Graphics; import javax.swing.*; public class Applet5 extends JApplet { int one, two, three, four; public void init() { String num1, num2, num3, num4; num1 = JOptionPane.showInputDialog("Enter the x value."); num2 = JOptionPane.showInputDialog("Enter the y value."); num3 = JOptionPane.showInputDialog("Enter the width."); num4 = JOptionPane.showInputDialog("Enter the height."); one = Integer.parseInt(num1); two = Integer.parseInt(num2); three = Integer.parseInt(num3); four = Integer.parseInt(num4); } public void paint(Graphics g) { super.paint( g ); g.drawOval(+one, +two, +three, +four); } }