Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package tp1;
- import javafx.application.Application;
- import javafx.event.ActionEvent;
- import javafx.event.EventHandler;
- import javafx.geometry.Insets;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.layout.FlowPane;
- import javafx.scene.layout.StackPane;
- import javafx.stage.Modality;
- import javafx.stage.Stage;
- import javafx.stage.StageStyle;
- /**
- *
- * @author daekc
- */
- public class TP1 extends Application {
- @Override
- public void start(Stage primaryStage) {
- //Stage secondStage = new Stage();
- FlowPane buttonFlow = new FlowPane();
- for(int i = 1; i <= 10;i++){
- Button btn = new Button();
- btn.setText("Bouton" + i);
- buttonFlow.getChildren().add(btn);
- buttonFlow.setMargin(btn, new Insets(4,4,4,4));
- }
- StackPane root = new StackPane();
- root.getChildren().add(buttonFlow);
- Scene scene = new Scene(root, 500, 250);
- primaryStage.setTitle("TP1 : JavaFX");
- primaryStage.setFullScreen(true);
- //primaryStage.setMaximized(true);
- //primaryStage.setOpacity(0.5);
- //primaryStage.setResizable(false);
- primaryStage.setScene(scene);
- //primaryStage.initStyle(StageStyle.UTILITY);
- //secondStage.initModality(Modality.NONE);
- //secondStage.initOwner(primaryStage);
- primaryStage.show();
- //secondStage.setX(primaryStage.getX()+primaryStage.getWidth());
- //secondStage.setY(primaryStage.getY());
- //secondStage.setHeight(primaryStage.getHeight());
- //secondStage.setWidth(primaryStage.getWidth());
- //secondStage.show();
- }
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- launch(args);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement