import java.awt.*; // for Graphics, Color, etc public class Square // a class to draw a Square { protected int x, y, size; // x,y coordinate of bounding box and height/width of square protected Color color; // color to draw the square public Square(int x, int y, int s, Color c) { this.x=x; this.y=y; size=s; color=c; } public void draw(Graphics g) { g.setColor(color); g.drawRect(x,y,size,size); } }