1 Reply Latest reply: Oct 17, 2012 6:00 AM by Tolls RSS

    Rectangle  within and applet

      In writing a simple program for rectangle I am getting an error.

      The method setDimensions(int, int) is undefined for the type Rectangle

      Here is my program:

      import java.awt.*;
      import java.applet.*;

      public class RectangleTest extends Applet{

           Rectangle r = new Rectangle();
           public void init(){
           public void paint (Graphics g){
                g.drawString("The area of rectangle r is " + r.area(),20,20);


      Please and Thank you - btw - I am new to java