PDA

View Full Version : Java auto closing alert windows?



Faisal
20-03-11, 23:40
Well sometimes I get the problem that the user does not click "Ok" to close a alert window in another programming language, so I was wondering if I could set up a timer so if they don't press "Ok" the program will automatically do so and close the alert window.

The reason I'm asking is the alert windows usually stop the whole program and it gets kinda annoying if a user can avoid a change by simply not doing anything.

I just want to know if it's possible.

njcsolutions
21-03-11, 00:30
Change the alert, to a kindof lightbox popup, inline alert would be possible then or another way is rather than an alert use a popup window with javascript timer to close.

sb89
22-03-11, 09:11
The best solution I found was to use JDialog instead of JOptionPane.

http://stackoverflow.com/questions/1306868/can-i-set-a-timer-on-a-java-swing-jdialog-box-to-close-after-a-number-of-millisec