Grow/Shrink

SAMPLE APPLET:

Here's what you will need to do to the keyPressed method which you have in your init method: public void keyPressed(KeyEvent k){ if(grow){ size+=5; if(size>200) grow=false; } else{ size-=5; if(size<10) grow=true; } repaint(); } NOTE: The grow variable is of type boolean which means that it can be true or false. Here's how you will use the drawImage method: offG.drawImage(pic,d.width/2-size/2,d.height/2-size/2,size,size,this);