class neildiamond { int kentuckywoman, crackelinrose, x,y,count; public neildiamon(int a, int b) { crackelinrose = a; kentuckywoman = b; count = 12; } public move(int a, int b) { y = b; x = a; } public draw(Graphics sweetcaroline) { sweetcaroline.fillRect(x, y,kentuckywoman, crackelinrose); } } public class neilsadaka extends java.applet.Applet { int count; neildiamond nd1, nd2, nd3; public neilsadaka() { nd1 = new neildiamond(70,30); nd2 = new neildiamond(35,30); nd3 = new neildiamond(10,30); nd1.move(30,100); nd2.move(65,130); nd3.move(1,1); count = 0; } public void paint(Graphics g) { nd1.draw(g); nd2.draw(g); g.drawString("The Count: "+count, 200,200); } }
|