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
| public class AutreSpec {
public void run() {
Display display = new Display();
Shell shell = new Shell (display, SWT.SHELL_TRIM); // SHELL_TRIM pour avoir la croix de fermeture, agrandissement, réduction
shell.setText("titre"); // donne un titre à la fenetre
createContents(shell); // appel pour créer les widgets
shell.setBounds(54, 164, 637, 480 ); // dimensionne la fenetre
shell.open(); // lance l'affichage
while (!shell.isDisposed()) { // boucle d'affichage
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose(); // fermeture
}
public void createContents(Composite compo) {
...
new MaSpec().createContents(compo);
}
public static void main (String[] args) {
new AutreSpec.run();
}
} |
Partager