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?
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.