final int DELAY_IN_MSEC = 100; // All caps means CONSTANT -- final enforces it! ... try { Thread.sleep(DELAY_IN_MSEC); } catch (Exception e) {}
Arrays.equals(array1, array2)
does not work!public void paintComponent(Graphics g)
; then when repaint is sent to the Frame,
paintComponent will be invoked in the panel.
public void paintComponent(Graphics g) {
g.setColor(Color.red);
g.fillRect(100,100,100,100);
}
g.drawLine(x1, y1, x2, y2)
is the method to draw a line).