/** Clear the image on this panel. */ public void clearImage() { Graphics imageGraphics = panelImage.getGraphics(); imageGraphics.setColor(Color.LIGHT_GRAY); imageGraphics.fillRect(0, 0, width, height); repaint(); }