I'm working on an analog clock that reads the current time with the GregorianCalender. My intent was to have my seconds hand move per second with the timer. So far, the seconds hand moves per second but the old seconds hands are visible along with the repainted seconds hand. I tried calling revalidate(), but that didn't do anything. I'll post my code, thank you!
Everything works now, thank you so much!
To repaint over an old image, you need to call the super's paintComponent method:
class MovingClockComponent extends JPanel
public void paintComponent(Graphics g)
Graphics2D ga = (Graphics2D) g;
Also, you'll want to read up on how to use code tags in this forum.