I am trying to create an Applet that draws 3 rectangles that have random size, color, and location. It also needs to draw new rectangles every time it is resized. Also, I need to create a class that represents a rectangle that knows its size, color, location, and how to draw itself.
I am not really sure how to start the constructor or the Applet.
I think the constructor looks something like:
public Rectangle(int x, int y, int size, Color c)
and it also has a method that looks something like:
public void draw(Graphics g)
Any help would be greatly appreciated.
Re: Java Constructor
Applets don't use a constructor. The startup code is in the init() and start() methods.