Search in sources :

Example 91 with TextField

use of javafx.scene.control.TextField in project JFoenix by jfoenixadmin.

the class TextFieldDemo method start.

@Override
public void start(Stage stage) throws Exception {
    final VBox pane = new VBox();
    pane.setSpacing(30);
    pane.setStyle("-fx-background-color:WHITE;-fx-padding:40;");
    pane.getChildren().add(new TextField());
    JFXTextField field = new JFXTextField();
    field.setLabelFloat(true);
    field.setPromptText("Type Something");
    pane.getChildren().add(field);
    JFXTextField disabledField = new JFXTextField();
    disabledField.setStyle(FX_LABEL_FLOAT_TRUE);
    disabledField.setPromptText("I'm disabled..");
    disabledField.setDisable(true);
    pane.getChildren().add(disabledField);
    JFXTextField validationField = new JFXTextField();
    validationField.setPromptText("With Validation..");
    RequiredFieldValidator validator = new RequiredFieldValidator();
    validator.setMessage("Input Required");
    FontIcon warnIcon = new FontIcon(FontAwesomeSolid.EXCLAMATION_TRIANGLE);
    warnIcon.getStyleClass().add(ERROR);
    validator.setIcon(warnIcon);
    validationField.getValidators().add(validator);
    validationField.focusedProperty().addListener((o, oldVal, newVal) -> {
        if (!newVal) {
            validationField.validate();
        }
    });
    pane.getChildren().add(validationField);
    JFXPasswordField passwordField = new JFXPasswordField();
    passwordField.setStyle(FX_LABEL_FLOAT_TRUE);
    passwordField.setPromptText("Password");
    validator = new RequiredFieldValidator();
    validator.setMessage("Password Can't be empty");
    warnIcon = new FontIcon(FontAwesomeSolid.EXCLAMATION_TRIANGLE);
    warnIcon.getStyleClass().add(ERROR);
    validator.setIcon(warnIcon);
    passwordField.getValidators().add(validator);
    passwordField.focusedProperty().addListener((o, oldVal, newVal) -> {
        if (!newVal) {
            passwordField.validate();
        }
    });
    pane.getChildren().add(passwordField);
    final Scene scene = new Scene(pane, 600, 400, Color.WHITE);
    scene.getStylesheets().add(TextFieldDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
    stage.setTitle("JFX TextField Demo ");
    stage.setScene(scene);
    stage.setResizable(false);
    stage.show();
}
Also used : JFXTextField(com.jfoenix.controls.JFXTextField) FontIcon(org.kordamp.ikonli.javafx.FontIcon) JFXPasswordField(com.jfoenix.controls.JFXPasswordField) TextField(javafx.scene.control.TextField) JFXTextField(com.jfoenix.controls.JFXTextField) Scene(javafx.scene.Scene) VBox(javafx.scene.layout.VBox) RequiredFieldValidator(com.jfoenix.validation.RequiredFieldValidator)

Example 92 with TextField

use of javafx.scene.control.TextField in project JFoenix by jfoenixadmin.

the class JFXDatePicker method initialize.

private void initialize() {
    this.getStyleClass().add(DEFAULT_STYLE_CLASS);
    try {
        editorProperty();
        Field editorField = DatePicker.class.getDeclaredField("editor");
        editorField.setAccessible(true);
        ReadOnlyObjectWrapper<TextField> editor = (ReadOnlyObjectWrapper<TextField>) editorField.get(this);
        final FakeFocusJFXTextField editorNode = new FakeFocusJFXTextField();
        this.focusedProperty().addListener((obj, oldVal, newVal) -> {
            if (getEditor() != null) {
                editorNode.setFakeFocus(newVal);
            }
        });
        editorNode.activeValidatorWritableProperty().bind(activeValidatorProperty());
        editor.set(editorNode);
    } catch (NoSuchFieldException e) {
    } catch (IllegalAccessException e) {
    }
}
Also used : TextField(javafx.scene.control.TextField) Field(java.lang.reflect.Field) TextField(javafx.scene.control.TextField) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper)

Example 93 with TextField

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

the class SearchBoxSkin method createTextField.

/**
 * Creates a new {@link TextField} object fitted to the given container.
 *
 * @param container The container to which the text field is added
 * @return The created text field
 */
private TextField createTextField(AnchorPane container) {
    TextField searchField = new TextField();
    searchField.getStyleClass().add("searchBar");
    searchField.prefHeightProperty().bind(container.prefHeightProperty());
    searchField.prefWidthProperty().bind(container.prefWidthProperty());
    AnchorPane.setLeftAnchor(searchField, 0.0);
    AnchorPane.setRightAnchor(searchField, 0.0);
    return searchField;
}
Also used : TextField(javafx.scene.control.TextField)

Example 94 with TextField

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

the class ClasspathRepositoryDetailsPanel method populate.

/**
 * Populates the repository details step for the classpath repository
 */
private void populate() {
    this.classpathField = new TextField();
    Label classpathLabel = new Label(tr("Classpath:"));
    classpathLabel.setLabelFor(classpathField);
    HBox content = new HBox(classpathLabel, classpathField);
    content.setId("addClasspathRepository");
    HBox.setHgrow(classpathField, Priority.ALWAYS);
    this.setCenter(content);
}
Also used : HBox(javafx.scene.layout.HBox) Label(javafx.scene.control.Label) TextField(javafx.scene.control.TextField)

Example 95 with TextField

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

the class StepRepresentationTextBox method drawStepContent.

@Override
protected void drawStepContent() {
    super.drawStepContent();
    setNextButtonEnabled(false);
    textField = new TextField();
    textField.textProperty().addListener((observable, oldValue, newValue) -> {
        if (StringUtils.isBlank(newValue)) {
            setNextButtonEnabled(false);
        } else {
            setNextButtonEnabled(true);
        }
    });
    textField.setText(defaultValue);
    textField.setLayoutX(10);
    textField.setLayoutY(40);
    this.addToContentPane(textField);
}
Also used : TextField(javafx.scene.control.TextField)

Aggregations

TextField (javafx.scene.control.TextField)224 Label (javafx.scene.control.Label)99 Button (javafx.scene.control.Button)71 Insets (javafx.geometry.Insets)62 HBox (javafx.scene.layout.HBox)46 GridPane (javafx.scene.layout.GridPane)44 Scene (javafx.scene.Scene)42 VBox (javafx.scene.layout.VBox)36 InputTextField (bisq.desktop.components.InputTextField)32 Node (javafx.scene.Node)30 Stage (javafx.stage.Stage)27 List (java.util.List)26 CheckBox (javafx.scene.control.CheckBox)24 ButtonType (javafx.scene.control.ButtonType)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