Hi I just recently passed my Java Prog Cert but still consider myself a beginner since most of my work has been theoretical until now... I am trying to build a small standalone app that pops up a frame every 30 minutes with a reminder. I have built a simple app to do that using java.util.Timer, but my problem is that I would automatically like the window to close after 1 minute if the user doesn't close it. For example if I am away from my pc for a few hours I don't want to come back and find lots of reminder windows on top of each other. Any ideas? Maybe I should have a single frame that automatically minimises and maximises itself instead? Jo
You can use a Timer for that as well. Start a timer when the window is set to visible. You can re-set the timer as needed whenever some activity occurs in the the window, perhaps by overriding repaint() to start a new Timer, then call the superclass version. If the timer counts down to zero, have it invoke a method in your Frame that closes it, ie, calls dispose(), or setVisible(false), etc.
Joined: Mar 20, 2002
duh! of course it's dispose... Thanks Rob - can't see the wood for the trees