This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a JLabel that I want to switch from visible to hidden. That much is working fine. Once it is turned visible, I want to hide it after n seconds. It is turned visible within a JButton ActionListener (if that really matters). Within that listener I tried simply creating a timer with a delay but that apparently blocks until the timer expires. At that point I decided to put the timer into a new thread so it would not block. That seems to work except it gets triggered before the delay expires. Since this is a child thread of the listener, does it immediately trigger because the parent (listener) has ended? How do I accomplish this?