import javax.swing.*; import java.awt.*; class PanelExt extends JPanel { PanelExt() { super(); } public void paint(Graphics g) { super.paint(g); System.out.println("paint called " + Ex6.numClicks); double dimX = getSize().getWidth(); double dimY = getSize().getHeight(); // Set the colour of the line g.setColor(Color.BLACK); // Note: origin is left/top corner double start_x = 0; double start_y = 0; double width = Ex6.numClicks*20; double height = 20; g.fillRect((int)(start_x), (int)(start_y), (int)(width), (int)(height)); } // End paint() } // End class JPanel