TextField resultado = new TextField(); resultado.setOnAction(e -> System.out.println("It works!"))
TextField textField = new TextField(); textField.setOnAction(e -> { AddBillTable selectedItem = table.getSelectionModel().getSelectedItem(); if (selectedItem != null) { selectedItem.setQuantity(Integer.parseInt(textField.getText())); } });
thread.start(); textField.setOnAction(evt -> { synchronized (messages) {
// you can of course define the text field in FXML if you prefer... TextField newAcronymTextField = new TextField(); newAcronymTextField.setOnAction(e -> { clientAcronymTable.getItems().add(newAcronymTextField.getText()); newAcronymTextField.clear(); });
@Override public void start(Stage primaryStage) { TextField tf = new TextField(); StackPane root = new StackPane(tf); Scene scene = new Scene(root, 300, 200); tf.setOnAction((ActionEvent event) -> { System.out.println(tf.getText()); tf.clear(); root.requestFocus(); }); primaryStage.setScene(scene); primaryStage.show(); }
ListView<String> lv = new ListView<>(); // Make cells editable lv.setEditable(true); lv.setCellFactory(TextFieldListCell.forListView()); // print selected item to the console lv.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { System.out.println("Selected Item: "+ newValue); }); TextField tf = new TextField(); // add new text from the textfield as item to the listview tf.setOnAction((event) -> { lv.getItems().add(tf.getText()); tf.clear(); }); VBox root = new VBox(lv, tf); // TODO: add root to scene
TextField textField = new TextField(); textField.setOnAction(evt -> { postMessage(textField.getText()); textField.clear();
tf.setOnAction(event -> { al.add(tf.getText()); System.out.println(al.get(0).toString());
textArea.setPrefRowCount(1); enterField.setOnAction(e -> sizeTextAreaToText(textArea, enterField.getText()));
VBox vbox = new VBox(); vbox.getChildren().addAll(tf1, tf2, tf3, button1, text); tf1.setOnAction(evt -> tf2.requestFocus()); tf2.setOnAction(evt -> tf3.requestFocus()); tf3.setOnAction(evt -> text.setText("From tf3")); button1.setOnAction(evt -> text.setText("From button1")); button1.defaultButtonProperty().bind(button1.focusedProperty());
TextField tf = new TextField(); String name = "Text field "+i ; tf.setOnAction(e -> { System.out.println("Action on "+name+": text is "+tf.getText()); });
webView = new WebView(); textField = new TextField("https://www.google.com"); textField.setOnAction(e -> load()); load();
Button openURLButton = new Button("Open URL"); EventHandler<ActionEvent> handler = e -> open(textField.getText()); textField.setOnAction(handler); openURLButton.setOnAction(handler);
}); tf.setOnAction(ae -> {
this.setAlignment(Pos.CENTER); textfield.setOnAction(e -> { cancelEdit(); });
addressBar.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { myWebEngine.load(addressBar.getText());
textField.setOnAction(goHandler); goButton.setOnAction(goHandler);
WebEngine engine = webView.getEngine(); locationBar.setOnAction(event -> engine.load(makeUrl(locationBar.getText())));
textField.setOnAction(e -> { getItem().setName(textField.getText()); setText(textField.getText());
location.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent event) {