final PasswordField password = new PasswordField(); password.setPromptText("Password"); return new Pair<>(username.getText(), password.getText().toCharArray());
fieldPass.setDisable(false); generatedUser.set(DEFAULT_USER); fieldUser.setDisable(true); fieldPass.setDisable(true); fieldPass.getText().toCharArray() );
PasswordField password = new PasswordField(); password.setPromptText("Password"); loginButton.setDisable(newValue.trim().isEmpty() || password.getText().isEmpty()); }); password.textProperty().addListener((observable, oldValue, newValue) -> { loginButton.setDisable(newValue.trim().isEmpty() || username.getText().isEmpty()); }); return new Pair<>(username.getText(), password.getText());
/** * {@inheritDoc} */ @Override public void initializeParts() { super.initializeParts(); getStyleClass().add("simple-password-control"); stack = new StackPane(); editableField = new javafx.scene.control.PasswordField(); editableField.setText(field.getValue()); readOnlyLabel = new Label(obfuscate(field.getValue())); fieldLabel = new Label(field.labelProperty().getValue()); editableField.setPromptText(field.placeholderProperty().getValue()); }
grid.add(passwordNewLabel, 0, 2); PasswordField passwordNew = new PasswordField(); grid.add(passwordNew, 1, 2); passwordNew.disableProperty().bind(passwordKey.textProperty().isEmpty().or(validKey.not())); passwordNew.textProperty().addListener((observable, oldValue, newValue) -> { if (!Strings.isNullOrEmpty(passwordKey.getText())){ observableAttributeValue.set(new EncryptedString(hashFunction.apply(newValue),passwordKey.getText()));
tf5.setEditable(false); textfieldBox3.getChildren().add(tf5); PasswordField pw1 = new PasswordField(); pw1.setText("password"); textfieldBox3.getChildren().add(pw1); txts.getChildren().add(textfieldBox3);
@Override public void handle(ActionEvent event) { try { if (serverRadioButton.isSelected()) { cleanup(); mainFactory.setHttpGuiCopperDataProvider(serverAddress.getText(), user.getText(), password.getText()); } } catch (Exception e) { throw new RuntimeException(e); } } });
|| "File".equals(fieldType) || "Directory".equals(fieldType)) { if ("Password".equals(fieldType)) { textField = new PasswordField(); } else { textField = new TextField();
password1 = new PasswordField(); password1.setMaxWidth(200); grid.add(password1, 1, row++); password2 = new PasswordField(); password2.setMaxWidth(200); grid.add(password2, 1, row++);
return false; if (password1.getText().trim().length() < 1) { password1.requestFocus(); messageText.setText("Password is required"); return false; if (!password1.getText().trim().equals(password2.getText())) { password1.requestFocus(); messageText.setText("Passwords are not the same"); return false;
private void readFromFile() { String filename = checkFileSuffix(); File file = new File(fileLocation.getText().trim(), filename); try { CredentialsReader reader = new CredentialsReader(file); Credentials credentials = reader.read(); userName.setText(credentials.getUsername()); password1.setText(credentials.getPassword()); password2.setText(credentials.getPassword()); messageText.setText(credentials.getUserData()); } catch (Exception e) { messageText.setText("Error occurred: " + e.getLocalizedMessage()); this.filename.requestFocus(); return; } userName.requestFocus(); }
public PasswordFieldPopupContent() { getStyleClass().setAll("pdfsam-input-password-content"); passwordField.setPromptText(DefaultI18nContext.getInstance().i18n("Enter the user password")); Button doneButton = FontAwesomeIconFactory.get().createIconButton(FontAwesomeIcon.UNLOCK, DefaultI18nContext.getInstance().i18n("Unlock")); doneButton.getStyleClass().addAll(Style.BUTTON.css()); doneButton.prefHeightProperty().bind(passwordField.heightProperty()); doneButton.setMaxHeight(USE_PREF_SIZE); doneButton.setMinHeight(USE_PREF_SIZE); doneButton.setOnAction(e -> requestLoad()); passwordField.setOnAction(e -> requestLoad()); getChildren().addAll(passwordField, doneButton); }
/** * {@inheritDoc} */ @Override public void setupBindings() { super.setupBindings(); editableField.visibleProperty().bind(field.editableProperty()); readOnlyLabel.visibleProperty().bind(field.editableProperty().not()); editableField.textProperty().bindBidirectional(field.userInputProperty()); obfuscatedUserInputBinding = Bindings.createStringBinding(() -> obfuscate(field.getUserInput()), field.userInputProperty()); readOnlyLabel.textProperty().bind(obfuscatedUserInputBinding); fieldLabel.textProperty().bind(field.labelProperty()); editableField.promptTextProperty().bind(field.placeholderProperty()); editableField.managedProperty().bind(editableField.visibleProperty()); }
public AquaPasswordFieldSkin(PasswordField passwordfield) { super(passwordfield); if (getSkinnable().isFocused()) { setFocusBorder(); } registerChangeListener(passwordfield.focusedProperty(), "FOCUSED"); }
@Override // This method is called by the FXMLLoader when initialization is complete public void initialize(URL fxmlFileLocation, ResourceBundle resources) { assert password != null : "fx:id=\"password\" was not injected: check your FXML file 'Login.fxml'."; assert serverAddress != null : "fx:id=\"serverAddress\" was not injected: check your FXML file 'Login.fxml'."; assert serverRadioButton != null : "fx:id=\"serverRadioButton\" was not injected: check your FXML file 'Login.fxml'."; assert startButton != null : "fx:id=\"startButton\" was not injected: check your FXML file 'Login.fxml'."; assert user != null : "fx:id=\"user\" was not injected: check your FXML file 'Login.fxml'."; ToggleGroup groupConnection = new ToggleGroup(); serverRadioButton.setSelected(true); serverRadioButton.setToggleGroup(groupConnection); user.disableProperty().bind(serverRadioButton.selectedProperty().not()); password.disableProperty().bind(serverRadioButton.selectedProperty().not()); serverAddress.disableProperty().bind(serverRadioButton.selectedProperty().not()); startButton.disableProperty().bind(serverAddress.textProperty().isEqualTo("")); startButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) { try { if (serverRadioButton.isSelected()) { cleanup(); mainFactory.setHttpGuiCopperDataProvider(serverAddress.getText(), user.getText(), password.getText()); } } catch (Exception e) { throw new RuntimeException(e); } } }); serverAddress.textProperty().bindBidirectional(settingsModelSingleton.lastConnectedServer); }
private void writeToFile() { String user = System.getProperty("user.name"); String userdata = "File created by " + user + " on " + new Date(); Credentials credentials = new Credentials(userName.getText().trim(), password1.getText().trim(), userdata); String filename = checkFileSuffix(); File file = new File(fileLocation.getText().trim(), filename); CredentialsWriter writer = new CredentialsWriter(file); try { writer.write(credentials); } catch (Exception e) { messageText.setText("Error occurred: " + e.getLocalizedMessage()); this.filename.requestFocus(); return; } messageText.setText("Write complete. " + userdata); userName.requestFocus(); }
pane.getChildren().add(new PasswordField()); pane.getChildren().add(new Separator());
@Override public void testImpl(Stage stage) { if (logger.isDebugEnabled()) { logger.debug("testrunn at -> " + sdf.format(new Date())); } stage.setTitle("Login"); //i18n stage.setScene(new Scene(root, 300, 275)); stage.show(); final Scene scene = stage.getScene(); //TestCode final TextField login = (TextField) scene.lookup("#loginField"); login.setText("LOGIN"); final PasswordField passwd = (PasswordField) scene.lookup("#passwordField"); passwd.setText("LOGIN"); final LoginPaneController controller = root.getController(); controller.handleSubmitButtonAction(new ActionEvent()); final Text feedback = (Text) scene.lookup("#feedback"); Assert.assertEquals("LOGIN logged in successfully", feedback.getText()); } }
/** * {@inheritDoc} */ @Override public void setupValueChangedListeners() { super.setupValueChangedListeners(); field.errorMessagesProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(editableField)); editableField.focusedProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(editableField)); }