Search in sources :

Example 81 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 82 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 83 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)

Example 84 with GridPane

use of javafx.scene.layout.GridPane in project blue by kunstmusik.

the class BlueJFXControlsApplication method setupButtonsTest.

private void setupButtonsTest(TabPane root) {
    SwingNode swingNode = new SwingNode();
    SwingUtilities.invokeLater(() -> swingNode.setContent(new JButton("Text 2")));
    GridPane gp = new GridPane();
    gp.addRow(0, new Label("JavaFX"), new Button("Text 1"));
    gp.addRow(1, new Label("Swing"), swingNode);
    gp.setVgap(5.0);
    gp.setHgap(5.0);
    gp.setPadding(new Insets(5, 5, 5, 5));
    root.getTabs().add(new Tab("Buttons", new BorderPane(gp)));
}
Also used : BorderPane(javafx.scene.layout.BorderPane) GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) Tab(javafx.scene.control.Tab) Button(javafx.scene.control.Button) JButton(javax.swing.JButton) JButton(javax.swing.JButton) Label(javafx.scene.control.Label) SwingNode(javafx.embed.swing.SwingNode)

Example 85 with GridPane

use of javafx.scene.layout.GridPane in project org.csstudio.display.builder by kasemir.

the class ImageConfigDialog method addAxisContent.

private int addAxisContent(final GridPane layout, int row, final Axis<Double> axis) {
    Label label = new Label("Start");
    layout.add(label, 1, row);
    final TextField start = new TextField(axis.getValueRange().getLow().toString());
    layout.add(start, 2, row++);
    label = new Label("End");
    layout.add(label, 1, row);
    final TextField end = new TextField(axis.getValueRange().getHigh().toString());
    layout.add(end, 2, row++);
    final EventHandler<ActionEvent> update_range = event -> {
        try {
            axis.setValueRange(Double.parseDouble(start.getText()), Double.parseDouble(end.getText()));
            plot.internalGetImagePlot().fireChangedAxisRange(axis);
        } catch (NumberFormatException ex) {
            start.setText(axis.getValueRange().getLow().toString());
            end.setText(axis.getValueRange().getHigh().toString());
            return;
        }
    };
    start.setOnAction(update_range);
    end.setOnAction(update_range);
    return row;
}
Also used : NamedColorMapping(org.csstudio.javafx.rtplot.NamedColorMapping) EventHandler(javafx.event.EventHandler) FontWeight(javafx.scene.text.FontWeight) Activator(org.csstudio.javafx.rtplot.Activator) NamedColorMappings(org.csstudio.javafx.rtplot.NamedColorMappings) TextField(javafx.scene.control.TextField) Modality(javafx.stage.Modality) Dialog(javafx.scene.control.Dialog) Label(javafx.scene.control.Label) ButtonType(javafx.scene.control.ButtonType) Node(javafx.scene.Node) CheckBox(javafx.scene.control.CheckBox) Font(javafx.scene.text.Font) ValueRange(org.csstudio.javafx.rtplot.data.ValueRange) ActionEvent(javafx.event.ActionEvent) ComboBox(javafx.scene.control.ComboBox) RTImagePlot(org.csstudio.javafx.rtplot.RTImagePlot) ImageView(javafx.scene.image.ImageView) ColorMappingFunction(org.csstudio.javafx.rtplot.ColorMappingFunction) Axis(org.csstudio.javafx.rtplot.Axis) GridPane(javafx.scene.layout.GridPane) ActionEvent(javafx.event.ActionEvent) Label(javafx.scene.control.Label) TextField(javafx.scene.control.TextField)

Aggregations

GridPane (javafx.scene.layout.GridPane)147 Label (javafx.scene.control.Label)83 Insets (javafx.geometry.Insets)67 Button (javafx.scene.control.Button)46 TextField (javafx.scene.control.TextField)42 VBox (javafx.scene.layout.VBox)37 Scene (javafx.scene.Scene)36 HBox (javafx.scene.layout.HBox)26 ButtonType (javafx.scene.control.ButtonType)25 Text (javafx.scene.text.Text)24 Node (javafx.scene.Node)23 Dialog (javafx.scene.control.Dialog)23 ColumnConstraints (javafx.scene.layout.ColumnConstraints)18 Stage (javafx.stage.Stage)18 TextWithStyle (org.phoenicis.javafx.views.common.TextWithStyle)17 List (java.util.List)16 CheckBox (javafx.scene.control.CheckBox)16 ImageView (javafx.scene.image.ImageView)14 ActionEvent (javafx.event.ActionEvent)13 ComboBox (javafx.scene.control.ComboBox)13