Search in sources :

Example 16 with TextField

use of javafx.scene.control.TextField in project Board-Instrumentation-Framework by intel.

the class Prompt_InputBox method SetupDialog.

@Override
protected Pane SetupDialog(Stage dialog) {
    GridPane root = new GridPane();
    root.setHgap(5.0);
    root.setVgap(5.0);
    root.setPadding(new Insets(5, 5, 2, 5));
    Button btn = new Button();
    btn.setText("OK");
    Label lblMessage = new Label(getMessage());
    Label lblSpacer = new Label("  ");
    lblMessage.setWrapText(true);
    TextField objPrompt = new TextField();
    if (null != _PrevVal) {
        objPrompt.setText(_PrevVal);
    }
    root.setAlignment(Pos.CENTER_LEFT);
    GridPane.setColumnSpan(lblMessage, 2);
    GridPane.setHalignment(btn, HPos.CENTER);
    if (getWidth() > 0) {
        objPrompt.setPrefWidth(getWidth());
    }
    if (getHeight() > 0) {
        root.setPrefHeight(getHeight());
    }
    root.add(lblMessage, 0, 0);
    root.add(objPrompt, 0, 2);
    root.add(btn, 0, 3);
    root.add(lblSpacer, 0, 4);
    // place on correct screen and center
    int xPos = (int) (Configuration.getConfig().getPrimaryScreen().getVisualBounds().getMinX());
    int yPos = (int) (Configuration.getConfig().getPrimaryScreen().getVisualBounds().getMinY());
    dialog.setX(xPos);
    dialog.setY(yPos);
    dialog.centerOnScreen();
    btn.setOnAction((ActionEvent event) -> {
        SetPromptedValue(objPrompt.getText());
        _PrevVal = objPrompt.getText();
        dialog.close();
    });
    return root;
}
Also used : GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) ActionEvent(javafx.event.ActionEvent) Label(javafx.scene.control.Label) TextField(javafx.scene.control.TextField)

Example 17 with TextField

use of javafx.scene.control.TextField in project drbookings by DrBookings.

the class JavaFXTest method start.

@Override
public void start(final Stage primaryStage) {
    final StackPane root = new StackPane();
    final TextFlow tf = new TextFlow();
    final Text t0 = new Text("First part");
    final Text t1 = new Text(", second");
    final TextField t2 = new TextField(" and very, very, very long third");
    t2.setEditable(false);
    t2.setBackground(Background.EMPTY);
    t2.setFocusTraversable(false);
    tf.getChildren().addAll(t0, t1, t2);
    root.getChildren().add(tf);
    final Scene scene = new Scene(root, 300, 250);
    primaryStage.setTitle("Hello World!");
    primaryStage.setScene(scene);
    primaryStage.show();
}
Also used : TextField(javafx.scene.control.TextField) TextFlow(javafx.scene.text.TextFlow) Text(javafx.scene.text.Text) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 18 with TextField

use of javafx.scene.control.TextField in project drbookings by DrBookings.

the class ICalSettingsController method initialize.

@Override
public void initialize(final URL location, final ResourceBundle resources) {
    try {
        final Map<String, String> map = SettingsManager.getInstance().getRoomNameMappings();
        final List<Map.Entry<String, String>> l = new ArrayList<>(map.entrySet());
        TextField vendor = null;
        TextField our = null;
        for (int i = 0; i < l.size(); i++) {
            if (i == 0) {
                vendor = vendorRoomName1;
                our = ourRoomName1;
            } else if (i == 1) {
                vendor = vendorRoomName2;
                our = ourRoomName2;
            } else if (i == 2) {
                vendor = vendorRoomName3;
                our = ourRoomName3;
            } else if (i == 3) {
                vendor = vendorRoomName4;
                our = ourRoomName4;
            } else if (i == 4) {
                vendor = vendorRoomName5;
                our = ourRoomName5;
            } else if (i == 5) {
                vendor = vendorRoomName6;
                our = ourRoomName6;
            } else if (i == 6) {
                vendor = vendorRoomName7;
                our = ourRoomName7;
            } else if (i == 7) {
                vendor = vendorRoomName8;
                our = ourRoomName8;
            } else {
                // no more mappings supported
                break;
            }
            vendor.setText(l.get(i).getKey());
            our.setText(l.get(i).getValue());
        }
    } catch (final Exception e) {
        if (logger.isErrorEnabled()) {
            logger.error(e.getLocalizedMessage(), e);
        }
    }
}
Also used : ArrayList(java.util.ArrayList) TextField(javafx.scene.control.TextField) IOException(java.io.IOException)

Example 19 with TextField

use of javafx.scene.control.TextField in project POL-POM-5 by PhoenicisOrg.

the class GitRepositoryDetailsPanel method populate.

/**
 * Populates the repository details step for the git repository
 */
private void populate() {
    this.urlField = new TextField();
    this.branchField = new TextField("master");
    Label urlLabel = new Label(tr("Git-Url:"));
    urlLabel.setLabelFor(urlField);
    Label branchLabel = new Label(tr("Branch:"));
    branchLabel.setLabelFor(branchField);
    GridPane grid = new GridPane();
    grid.getStyleClass().add("grid");
    grid.add(urlLabel, 0, 0);
    grid.add(urlField, 1, 0);
    grid.add(branchLabel, 0, 1);
    grid.add(branchField, 1, 1);
    this.setCenter(grid);
}
Also used : GridPane(javafx.scene.layout.GridPane) Label(javafx.scene.control.Label) TextField(javafx.scene.control.TextField)

Example 20 with TextField

use of javafx.scene.control.TextField in project POL-POM-5 by PhoenicisOrg.

the class LocalRepositoryDetailsPanel method populate.

/**
 * Populates the repository details step for the local repository
 */
private void populate() {
    this.pathField = new TextField();
    this.openBrowser = new Button(tr("Open directory chooser"));
    openBrowser.setOnAction(event -> {
        DirectoryChooser chooser = new DirectoryChooser();
        File directory = chooser.showDialog(null);
        pathField.setText(directory.toString());
    });
    HBox content = new HBox(pathField, openBrowser);
    content.setId("addLocalRepository");
    HBox.setHgrow(pathField, Priority.ALWAYS);
    this.setCenter(content);
}
Also used : HBox(javafx.scene.layout.HBox) Button(javafx.scene.control.Button) TextField(javafx.scene.control.TextField) File(java.io.File) DirectoryChooser(javafx.stage.DirectoryChooser)

Aggregations

TextField (javafx.scene.control.TextField)218 Label (javafx.scene.control.Label)98 Button (javafx.scene.control.Button)68 Insets (javafx.geometry.Insets)62 HBox (javafx.scene.layout.HBox)45 GridPane (javafx.scene.layout.GridPane)44 Scene (javafx.scene.Scene)42 VBox (javafx.scene.layout.VBox)34 InputTextField (bisq.desktop.components.InputTextField)32 Node (javafx.scene.Node)30 Stage (javafx.stage.Stage)27 List (java.util.List)26 ButtonType (javafx.scene.control.ButtonType)23 CheckBox (javafx.scene.control.CheckBox)23 Tooltip (javafx.scene.control.Tooltip)23 StackPane (javafx.scene.layout.StackPane)22 ArrayList (java.util.ArrayList)21 Dialog (javafx.scene.control.Dialog)21 BorderPane (javafx.scene.layout.BorderPane)19 ImageView (javafx.scene.image.ImageView)18