This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JOptionPane question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JOptionPane question" Watch "JOptionPane question" New topic
Author

JOptionPane question

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I want a dialog box to open with an informational message and remain
open for 3 seconds then close. Can I do this with JOptionPane? If not,
what should I use?

Thanks.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

From the Java Tutorial: How To Make Dialogs

For most simple modal dialogs, you create and show the dialog using one of JOptionPane's showXxxDialog methods. . . If you need to control the dialog's window-closing behavior or if the dialog isn't modal, then you should directly instantiate JOptionPane and add it to a JDialog instance. Then invoke setVisible(true) on the JDialog to make it appear.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
You can use a JWindow with a timer.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JOptionPane question
 
Similar Threads
java alert
JOptionPane.showMessageDialog()
JOptionPane
How to make the only the Child form enabled?
Weird actionPerformed method.