Example usage for javafx.scene.control PasswordField setPrefColumnCount

List of usage examples for javafx.scene.control PasswordField setPrefColumnCount

Introduction

In this page you can find the example usage for javafx.scene.control PasswordField setPrefColumnCount.

Prototype

public final void setPrefColumnCount(int value) 

Source Link

Usage

From source file:Main.java

private static Node createLoginPanel() {
    final ToggleGroup toggleGroup = new ToggleGroup();

    final TextField textField = new TextField();
    textField.setPrefColumnCount(10);//  w  ww . j  a  va 2 s. c o m
    textField.setPromptText("Your name");

    final PasswordField passwordField = new PasswordField();
    passwordField.setPrefColumnCount(10);
    passwordField.setPromptText("Your password");

    final ChoiceBox<String> choiceBox = new ChoiceBox<String>(FXCollections.observableArrayList("English",
            "\u0420\u0443\u0441\u0441\u043a\u0438\u0439", "Fran\u00E7ais"));
    choiceBox.setTooltip(new Tooltip("Your language"));
    choiceBox.getSelectionModel().select(0);

    final HBox panel = createHBox(6, createVBox(2, createRadioButton("High", toggleGroup, true),
            createRadioButton("Medium", toggleGroup, false), createRadioButton("Low", toggleGroup, false)),
            createVBox(2, textField, passwordField), choiceBox);
    panel.setAlignment(Pos.BOTTOM_LEFT);
    configureBorder(panel);

    return panel;
}