建议你看看JDK/demo/jfc/swingset2/SwingSet2.jar是怎么做的。 这一段对你会有帮助: // Create and throw the splash screen up. Since this will // physically throw bits on the screen, we need to do this // on the GUI thread using invokeLater. createSplashScreen(); // do the following on the gui thread SwingUtilities.invokeLater(new Runnable() { public void run() { showSplashScreen(); } });
initializeDemo(); preloadFirstDemo(); // Show the demo and take down the splash screen. Note that // we again must do this on the GUI thread using invokeLater. SwingUtilities.invokeLater(new Runnable() { public void run() { showSwingSet2(); hideSplash(); } });
这一段对你会有帮助: // Create and throw the splash screen up. Since this will
// physically throw bits on the screen, we need to do this
// on the GUI thread using invokeLater.
createSplashScreen(); // do the following on the gui thread
SwingUtilities.invokeLater(new Runnable() {
public void run() {
showSplashScreen();
}
});
initializeDemo();
preloadFirstDemo(); // Show the demo and take down the splash screen. Note that
// we again must do this on the GUI thread using invokeLater.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
showSwingSet2();
hideSplash();
}
});