1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
public class Demo {
boolean packFrame = false;
Opening_Window opening;
//Construct the application
public Demo() {
opening = new Opening_Window();
//Affichage de la fenetre d'accueil pour l'ouverture du logiciel
Cadre frame = new Cadre();
//Validate frames that have preset sizes
//Pack frames that have useful preferred size info, e.g. from their layout
if (packFrame) {
frame.pack();
}
else {
frame.validate();
}
//Window en plein écran
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
Rectangle bounds = env.getMaximumWindowBounds();
frame.setBounds(bounds);
frame.setVisible(true);
opening.setVisible(false); // affichage de l'image d'accueil du logiciel
}
//Main method
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch(Exception e) {
e.printStackTrace();
}
new Demo();
}
} |