How to put a splash screen in front of the main UI?
Hi guys,
I am a newbie of this forum, and I've got a problem want to discuss with you.
How to put a splash screen in front of the main UI? My requirement is displaying a splash screen before the main UI is ready (maybe loading something at the backend). Moreover, I need the splash screen displays on top of the main UI, but all the components in the main UI should be gray out.
I wrote some codes (partially as following), but it seems didn't work like I expected.
Thanks very much.
Code:
public class testGUI
{
public static void main(String args[])
{
testGUISplash splash = new testGUISplash(5000);
// splash.setAlwaysOnTop(true);
splash.showSplash();
java.awt.EventQueue.invokeLater(new Runnable()
{
public void run() {
testGUIView view = new testGUIView();
// view.setAlwaysOnTop(true);
view.setVisible(true);
}
}
);
}
}