Package javafx.scene.layout

Examples of javafx.scene.layout.FlowPane


    GridPane.setMargin(surnameTextField, insets);

    BorderPane.setAlignment(gridPane, Pos.CENTER);
    borderPane.setCenter(gridPane);

    FlowPane flow = new FlowPane();
    flow.setAlignment(Pos.CENTER);

    okButton = new Button("Valider");
    okButton.setOnAction(new DisplayConfirm());
    okButton.setDefaultButton(true);
    flow.getChildren().add(okButton);
    FlowPane.setMargin(okButton, insets);

    exitButton = new Button("Quitter");
    exitButton.setOnAction(new EventHandler() {

      @Override
      public void handle(Event arg0) {
        // TODO Auto-generated method stub
        close();
      }

    });
    exitButton.setCancelButton(true);
    flow.getChildren().add(exitButton);
    FlowPane.setMargin(exitButton, insets);

    BorderPane.setAlignment(flow, Pos.CENTER);
    borderPane.setBottom(flow);
View Full Code Here


    scene = new Scene(borderPane, 750, 612);   
  }
 
  private void loadGameInterface(){
    FlowPane infosPane = new FlowPane(Orientation.VERTICAL);
    infosPane.setStyle("-fx-background-image: url(\"res\\ihm\\texture.jpg\");");
   
    Insets in = new Insets(10, 0, 0, 0);

    roundScoreLabel = new Label();
    FlowPane.setMargin(roundScoreLabel, in);
   
    trumpLabel = new Label();
    FlowPane.setMargin(trumpLabel, in);
   
    gameScoreLabel = new Label();
    FlowPane.setMargin(gameScoreLabel, in);
   
    tchatListView = new ListView();
    tchatListView.setMaxHeight(300);
    FlowPane.setMargin(tchatListView, in);
   
    tchatTextField = new TextField();
    tchatTextField.setMaxHeight(50);
    tchatTextField.setMinHeight(20);
    tchatTextField.setOnAction(new TchatHandler());
    FlowPane.setMargin(tchatTextField, in);
       
    beloteCheck = new CheckBox(" Belote");
    beloteCheck.setVisible(false);
    FlowPane.setMargin(beloteCheck, in);

    foldGrid = new GridPane();
    FlowPane.setMargin(foldGrid, in);
   
    infosPane.getChildren().addAll(roundScoreLabel, trumpLabel, gameScoreLabel, tchatListView, tchatTextField, beloteCheck, foldGrid);
   
   
    BorderPane.setMargin(infosPane, new Insets(0, 10, 0, 10));
    borderPane.setRight(infosPane);
    borderPane.setStyle("-fx-background-image: url(\"res\\ihm\\texture.jpg\");");
View Full Code Here

    scene = new Scene(borderPane, 750, 612);   
  }
 
  private void loadGameInterface(){
    FlowPane infosPane = new FlowPane(Orientation.VERTICAL);
    infosPane.setStyle("-fx-background-image: url(\"res\\ihm\\texture.jpg\");");
   
    Insets in = new Insets(10, 0, 0, 0);

    roundScoreLabel = new Label();
    FlowPane.setMargin(roundScoreLabel, in);
   
    trumpLabel = new Label();
    FlowPane.setMargin(trumpLabel, in);
   
    gameScoreLabel = new Label();
    FlowPane.setMargin(gameScoreLabel, in);
   
    tchatListView = new ListView();
    tchatListView.setMaxHeight(300);
    FlowPane.setMargin(tchatListView, in);
   
    tchatTextField = new TextField();
    tchatTextField.setMaxHeight(50);
    tchatTextField.setMinHeight(20);
    tchatTextField.setOnAction(new TchatHandler());
    FlowPane.setMargin(tchatTextField, in);
       
    beloteCheck = new CheckBox(" Belote");
    beloteCheck.setVisible(false);
    FlowPane.setMargin(beloteCheck, in);

    foldGrid = new GridPane();
    FlowPane.setMargin(foldGrid, in);
   
    infosPane.getChildren().addAll(roundScoreLabel, trumpLabel, gameScoreLabel, tchatListView, tchatTextField, beloteCheck, foldGrid);
   
   
    BorderPane.setMargin(infosPane, new Insets(0, 10, 0, 10));
    borderPane.setRight(infosPane);
    borderPane.setStyle("-fx-background-image: url(\"res\\ihm\\texture.jpg\");");
View Full Code Here

    GridPane.setMargin(teammateTextField, insets);

    BorderPane.setAlignment(gridPane, Pos.CENTER);
    borderPane.setCenter(gridPane);

    FlowPane flow = new FlowPane();
    flow.setAlignment(Pos.CENTER);

    okButton = new Button("Valider");
    okButton.setOnAction(new EventHandler() {
      @Override
      public void handle(Event arg0) {
        // TODO Auto-generated method stub
        try {
          if (sql.getInstance().insertTeam(
              CreationTeamStage.this.teamTextField.getText(),
              CreationTeamStage.this.teammateTextField.getText(),
              CreationTeamStage.this.idS)) {
            MessageBox message = new MessageBox("Equipe Cr��",
                "F�licitation, l'�quipe "
                    + CreationTeamStage.this.teamTextField
                        .getText() + " a �t� cr�e.");
            message.showDialog();

          } else {
            MessageBox message = new MessageBox("Echec",
                "Creation Impossible");
            message.showDialog();
          }
        } catch (SQLException e) {
          MessageBox message = new MessageBox("Echec", e.getMessage());
          message.showDialog();
        }
      }
    });
    okButton.setDefaultButton(true);
    flow.getChildren().add(okButton);
    FlowPane.setMargin(okButton, insets);

    exitButton = new Button("Quitter");
    exitButton.setOnAction(new EventHandler() {

      @Override
      public void handle(Event arg0) {
        // TODO Auto-generated method stub
        close();
      }
    });
    exitButton.setCancelButton(true);
    flow.getChildren().add(exitButton);
    FlowPane.setMargin(exitButton, insets);

    BorderPane.setAlignment(flow, Pos.CENTER);
    borderPane.setBottom(flow);
View Full Code Here

            if (content != null) {
                contentPanel.setCenter(content);
                contentPanel.setPadding(new Insets(0, 0, 12, 0));
            }

            FlowPane buttonsPanel = new FlowPane(6, 0) {
                @Override protected void layoutChildren() {
                    /*
                    * According to UI guidelines, all buttons should have the same length.
                    * This function is to define the longest button in the array of buttons
                    * and set all buttons in array to be the length of the longest button.
                    */
                    // Find out the longest button...
                    double widest = 50;
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        widest = Math.max(widest, btn.prefWidth(-1));
                    }

                    // ...and set all buttons to be this width
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        btn.setPrefWidth(btn.isVisible() ? widest : 0);
                    }
                   
                    super.layoutChildren();
                }
            };
            buttonsPanel.getStyleClass().add("button-bar");

            // Create buttons from okBtnStr and cancelBtnStr strings.
            buttonsPanel.getChildren().addAll(createButtons());

            if (contentPanel.getChildren().size() > 0) {
                centerPanel.getChildren().add(contentPanel);
            }

View Full Code Here

            if (content != null) {
                contentPanel.setCenter(content);
                contentPanel.setPadding(new Insets(0, 0, 12, 0));
            }

            FlowPane buttonsPanel = new FlowPane(6, 0) {
                @Override protected void layoutChildren() {
                    /*
                    * According to UI guidelines, all buttons should have the same length.
                    * This function is to define the longest button in the array of buttons
                    * and set all buttons in array to be the length of the longest button.
                    */
                    // Find out the longest button...
                    double widest = 50;
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        widest = Math.max(widest, btn.prefWidth(-1));
                    }

                    // ...and set all buttons to be this width
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        btn.setPrefWidth(btn.isVisible() ? widest : 0);
                    }
                   
                    super.layoutChildren();
                }
            };
            buttonsPanel.getStyleClass().add("button-bar");

            // Create buttons from okBtnStr and cancelBtnStr strings.
            buttonsPanel.getChildren().addAll(createButtons());

            if (contentPanel.getChildren().size() > 0) {
                centerPanel.getChildren().add(contentPanel);
            }

View Full Code Here

            if (content != null) {
                contentPanel.setCenter(content);
                contentPanel.setPadding(new Insets(0, 0, 12, 0));
            }

            FlowPane buttonsPanel = new FlowPane(6, 0) {
                @Override protected void layoutChildren() {
                    /*
                    * According to UI guidelines, all buttons should have the same length.
                    * This function is to define the longest button in the array of buttons
                    * and set all buttons in array to be the length of the longest button.
                    */
                    // Find out the longest button...
                    double widest = 50;
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        widest = Math.max(widest, btn.prefWidth(-1));
                    }

                    // ...and set all buttons to be this width
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        btn.setPrefWidth(btn.isVisible() ? widest : 0);
                    }
                   
                    super.layoutChildren();
                }
            };
            buttonsPanel.getStyleClass().add("button-bar");

            // Create buttons from okBtnStr and cancelBtnStr strings.
            buttonsPanel.getChildren().addAll(createButtons());

            if (contentPanel.getChildren().size() > 0) {
                centerPanel.getChildren().add(contentPanel);
            }

View Full Code Here

            if (content != null) {
                contentPanel.setCenter(content);
                contentPanel.setPadding(new Insets(0, 0, 12, 0));
            }

            FlowPane buttonsPanel = new FlowPane(6, 0) {
                @Override protected void layoutChildren() {
                    /*
                    * According to UI guidelines, all buttons should have the same length.
                    * This function is to define the longest button in the array of buttons
                    * and set all buttons in array to be the length of the longest button.
                    */
                    // Find out the longest button...
                    double widest = 50;
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        widest = Math.max(widest, btn.prefWidth(-1));
                    }

                    // ...and set all buttons to be this width
                    for (int i = 0; i < buttons.size(); i++) {
                        Button btn = buttons.get(i);
                        if (btn == null) continue;
                        btn.setPrefWidth(btn.isVisible() ? widest : 0);
                    }
                   
                    super.layoutChildren();
                }
            };
            buttonsPanel.getStyleClass().add("button-bar");

            // Create buttons from okBtnStr and cancelBtnStr strings.
            buttonsPanel.getChildren().addAll(createButtons());

            if (contentPanel.getChildren().size() > 0) {
                centerPanel.getChildren().add(contentPanel);
            }

View Full Code Here

TOP

Related Classes of javafx.scene.layout.FlowPane

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.