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 41
|
public class L extends Application {
@Override
public void start(Stage primaryStage) {
GridPane a = new GridPane();
TextField fd1 = new TextField("Bienvenue a tous ahahahah");
TextField fd2 = new TextField("Entre votre nom");
Button b1 = new Button("valider");
Button b2 = new Button("valider");
a.add(fd1,0,0);
a.add(fd2,0,1);
a.add(b1,1,0);
a.add(b2,1,1);
System.out.println("largeur "+a.getWidth());
System.out.println("hauteur "+a.getHeight());
a.setPadding(new Insets(400-a.getHeight(),400+a.getWidth(),400+a.getHeight(),400-a.getWidth()));
a.setGridLinesVisible(true);
Scene scene = new Scene(a, 800, 800);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
} |
Partager