Growing and Shrinking Square
Get this applet running. (grow is a variable of type boolean and size is a
variable of type int)
PUT THIS IN YOUR KeyPressed METHOD:
if(grow){
size+=10;
if(size>=160) grow=false;
}
else {
size-=10;
if(size<=10) grow=true;
}
repaint();