Make text appear briefly in a JPanel
- by Roo
Hi,
I am trying to make text appear briefly before it disappears. It would be along the lines of
1) Set color to black
2) wait x amount of seconds
3) set color to background color
The method I call is repaint(), which then calls paintComponent(Graphics painter). repaint() is called only if I press the space-bar.
I thought of trying repaint();Thread.sleep(1000);repaint(); (I do catch the Interrupt exception, just not shown), but it only calls paintComponent once per space-bar .
Is there an easy way to do this or is this something that is a bit challenging?