How can I draw an image that would be available for just a few seconds?

```
@Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
if (dots % 3 == 0 && dots != 3){
                g.drawImage(clocks, clocksX, clocksY, this);
            }
}

```

Thanks