The problem is in your paint method. Try this instead.


public void paint (Graphics g) {

//Cast the Graphics object into a Graphics2D object
Graphics g2 =...