/* Rectangles.java
   An applet to illustrate drawing rectangles
   */
import java.applet.*;
import java.awt.*;
import javax.swing.*;

// The panel class for drawing

class MyPanel extends JPanel {
     
   public void paintComponent(Graphics grafObj) {
      super.paintComponent(grafObj);
      grafObj.drawRect(10, 10, 80, 60);
      grafObj.fillRect(120, 10, 60, 80);
      grafObj.drawRoundRect(10, 120, 80, 60, 20, 30);
      grafObj.fillRoundRect(120, 120, 60, 80, 40, 40);
   }
}

// The Rectangles applet

public class Rectangles extends JApplet {
   Container rectangleArea = getContentPane();
   MyPanel newPanel = new MyPanel();

// The init method for the applet - adds the panel to
//  the content area of the applet

   public void init() {
      rectangleArea.add(newPanel);
   }
}

