how to make jdialog or joption pane automatically vanish ?
1 posts in topic
Flat View  Flat View

Posted By:   sarim_raza
Posted On:   Thursday, September 5, 2002 12:11 PM

its easy to make joption, but these guys only vanish when i click ok ..

if i want it to vanish automatically after some time (i know the time bit - using threads) .. is one way to remove() from the parent container and call validate() so that the
container refreshes ?

if parent container has border layout do i have to put dialog in some part of it, since dialogs normally visually appear to be independant (not fitted within a container).

the way joption function, we never put it inside any container, i wish to achieve the same, but make it vanish without clicking on its default ok button


Re: how to make jdialog or joption pane automatically vanish ?

Posted By:   Mike_Friedrich  
Posted On:   Friday, September 6, 2002 08:42 AM

You can try this:

final JDialog dialog = pane.createDialog(parentComponent, title);
new Thread() {
public void run() {
// wait your time
javax.swing.SwingUtilies.invokeLater(new Runnable() {
public void run() {
dialog.show(); // blocks the current thread

Regards, Mike

About | Sitemap | Contact