Search in sources :

Example 31 with GridPane

use of javafx.scene.layout.GridPane in project trex-stateless-gui by cisco-system-traffic-generator.

the class CustomTreeItem method buildItem.

/**
     * build custom tree item
     *
     * @param title
     * @param owner
     * @param assignedText
     * @param addIcon
     */
private void buildItem(String title, String owner, String addIcon) {
    GridPane itemContainer = new GridPane();
    // additioanl icon
    if (addIcon != null) {
        Image icon = new Image("/icons/" + addIcon);
        ImageView iconContainer = new ImageView(icon);
        itemContainer.add(iconContainer, 0, 0);
    }
    itemTitle.setText(title);
    itemTitle.getStyleClass().add("treeItemTitle");
    itemContainer.add(itemTitle, 1, 0);
    if (owner != null && !"".equals(owner)) {
        this.owner = new Label("(" + owner + ")");
        this.owner.getStyleClass().add("treeItemChildText");
        itemContainer.add(this.owner, 2, 0);
    }
    Image itemIcon = new Image("/icons/" + treeItemType.getIcon());
    ImageView itemIconContainer = new ImageView(itemIcon);
    setValue(itemContainer);
    setGraphic(itemIconContainer);
}
Also used : GridPane(javafx.scene.layout.GridPane) Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image)

Example 32 with GridPane

use of javafx.scene.layout.GridPane in project big-math by eobermuhlner.

the class GraphApp method createEditor.

private Node createEditor() {
    GridPane gridPane = new GridPane();
    gridPane.setHgap(4);
    gridPane.setVgap(4);
    int rowIndex = 0;
    gridPane.add(new Label("X Start:"), 0, rowIndex);
    TextField xStartTextField = new TextField();
    gridPane.add(xStartTextField, 1, rowIndex);
    Bindings.bindBidirectional(xStartTextField.textProperty(), xStartProperty, BIGDECIMAL_STRING_CONVERTER);
    rowIndex++;
    gridPane.add(new Label("X End:"), 0, rowIndex);
    TextField xEndTextField = new TextField();
    gridPane.add(xEndTextField, 1, rowIndex);
    Bindings.bindBidirectional(xEndTextField.textProperty(), xEndProperty, BIGDECIMAL_STRING_CONVERTER);
    rowIndex++;
    gridPane.add(new Label("Y Start:"), 0, rowIndex);
    TextField yStartTextField = new TextField();
    gridPane.add(yStartTextField, 1, rowIndex);
    Bindings.bindBidirectional(yStartTextField.textProperty(), yStartProperty, BIGDECIMAL_STRING_CONVERTER);
    rowIndex++;
    gridPane.add(new Label("Y End:"), 0, rowIndex);
    TextField yEndTextField = new TextField();
    gridPane.add(yEndTextField, 1, rowIndex);
    Bindings.bindBidirectional(yEndTextField.textProperty(), yEndProperty, BIGDECIMAL_STRING_CONVERTER);
    rowIndex++;
    gridPane.add(new Label("Precision:"), 0, rowIndex);
    TextField precisionTextField = new TextField();
    gridPane.add(precisionTextField, 1, rowIndex);
    Bindings.bindBidirectional(precisionTextField.textProperty(), precisionProperty, INTEGER_FORMAT);
    rowIndex++;
    gridPane.add(new Label("Function 1:"), 0, rowIndex);
    TextField function1TextField = new TextField();
    gridPane.add(function1TextField, 1, rowIndex);
    Bindings.bindBidirectional(function1TextField.textProperty(), function1Property);
    rowIndex++;
    gridPane.add(new Label("Function 2:"), 0, rowIndex);
    TextField function2TextField = new TextField();
    gridPane.add(function2TextField, 1, rowIndex);
    Bindings.bindBidirectional(function2TextField.textProperty(), function2Property);
    rowIndex++;
    gridPane.add(new Label("Function 3:"), 0, rowIndex);
    TextField function3TextField = new TextField();
    gridPane.add(function3TextField, 1, rowIndex);
    Bindings.bindBidirectional(function3TextField.textProperty(), function3Property);
    rowIndex++;
    return gridPane;
}
Also used : GridPane(javafx.scene.layout.GridPane) Label(javafx.scene.control.Label) TextField(javafx.scene.control.TextField)

Example 33 with GridPane

use of javafx.scene.layout.GridPane in project chuidiang-ejemplos by chuidiang.

the class Example1 method buildAndShowMainWindow.

private void buildAndShowMainWindow(Stage primaryStage) {
    primaryStage.setTitle("Hello World!!");
    GridPane gridPane = new GridPane();
    gridPane.setAlignment(Pos.CENTER);
    gridPane.setHgap(10);
    gridPane.setVgap(10);
    gridPane.setPadding(new Insets(25, 25, 25, 25));
    button = new Button("Click me!");
    gridPane.add(button, 1, 1);
    text = new TextField();
    gridPane.add(text, 2, 1);
    clockLabel = new Label();
    gridPane.add(clockLabel, 1, 2, 2, 1);
    Scene scene = new Scene(gridPane);
    primaryStage.setScene(scene);
    primaryStage.show();
}
Also used : GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) Label(javafx.scene.control.Label) TextField(javafx.scene.control.TextField) Scene(javafx.scene.Scene)

Example 34 with GridPane

use of javafx.scene.layout.GridPane in project chuidiang-ejemplos by chuidiang.

the class ExampleCss method buildAndShowMainWindow.

private void buildAndShowMainWindow(Stage primaryStage) {
    primaryStage.setTitle("Hello World!!");
    GridPane gridPane = new GridPane();
    gridPane.setAlignment(Pos.CENTER);
    gridPane.setHgap(10);
    gridPane.setVgap(10);
    gridPane.setPadding(new Insets(25, 25, 25, 25));
    button = new Button("Click me!");
    button.setId("TheButton");
    gridPane.add(button, 1, 1);
    text = new TextField();
    gridPane.add(text, 2, 1);
    clockLabel = new Label();
    gridPane.add(clockLabel, 1, 2, 2, 1);
    Scene scene = new Scene(gridPane);
    primaryStage.setScene(scene);
    scene.getStylesheets().add(getClass().getResource("/form.css").toExternalForm());
    primaryStage.show();
}
Also used : GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) Label(javafx.scene.control.Label) TextField(javafx.scene.control.TextField) Scene(javafx.scene.Scene)

Aggregations

GridPane (javafx.scene.layout.GridPane)34 Label (javafx.scene.control.Label)22 Insets (javafx.geometry.Insets)13 Button (javafx.scene.control.Button)9 TextField (javafx.scene.control.TextField)9 Scene (javafx.scene.Scene)7 TextWithStyle (org.phoenicis.javafx.views.common.TextWithStyle)7 Dialog (javafx.scene.control.Dialog)6 VBox (javafx.scene.layout.VBox)6 Text (javafx.scene.text.Text)5 Stage (javafx.stage.Stage)5 Pair (javafx.util.Pair)5 ButtonType (javafx.scene.control.ButtonType)4 Region (javafx.scene.layout.Region)4 JFXButton (com.jfoenix.controls.JFXButton)3 MaterialDesignIconView (de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Node (javafx.scene.Node)3 ScrollPane (javafx.scene.control.ScrollPane)3