Java Reference
In-Depth Information
L ISTING 8.10 Continued
aLabel.setLayout(new BorderLayout());
aLabel.add(new JLabel(“An Application..”));
getContentPane().add(aLabel);
addWindowListener( new java.awt.event.WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
pack();
setVisible(true);
}
public static void main(String[] args) {
App app = new App();
}
}
Execution
Now that we've had a look at the source, it is time to see some action. First of all, as evident
from Figure 8.8, pardon my UI design skills; I'm sure you'll be able to design better splash
windows!
F IGURE 8.8
Our splash window at work.
After the splash window entertained users during the program deployment, the application is
finally launched, as shown in Figure 8.9.
F IGURE 8.9
After all the resources are downloaded, the application starts.
Search WWH ::




Custom Search