import java.awt.*;
import javax.swing.*;
public class DrawingPanel extends JPanel {
public void paintComponent(Graphics g)
{
// clear screen
g.setColor(Color.white);
g.clearRect(0,0,500,500);
{
System.out.printf("Spring Design Barker Spring 2018%n");
int x = 125;
int y = 125;
int w = 50;
int h =80;
int b = 50;
int rd = 255 ;
int gn = 255 ;
int bl = 0 ;
Circle c1,c2;
Rectangle r1,r2;
Triangle t1,t2;
Color clr1,c;
clr1 = new Color(rd,gn,bl);
r1 = new Rectangle(x,y,w,h,clr1);
clr1 = new Color(106,96,200);
t1=new Triangle(x,y,w,h,clr1);
clr1 = new Color(220,15,15);
c1=new Circle(x,25,25,clr1);
r1.draw(g); /*display the rectangle */
t1.draw(g); /*display the triangle */
c1.draw(g); /*display the circle */
t1.setH(-h); /*display the triangle */
t1.setColor(new Color(15,220,15)); /*display the triangle */
t1.draw(g); /*display the triangle */
x=200;
y=200;
for(int k=0;k<9;k++)
{
c=new Color(255-k*20,0+k*15,0+k*25); // vary color
c1=new Circle(200,10 * k,50,c);
c1.draw(g); /*display the new circle */
}
//c=new Color(0,255,0); // change paint in can to green
//c2=new Circle(300,50,10,c);
//c2.draw(g); /*display the new circle */
}
}
}