import com.sun.javafx.runtime.VersionInfo; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.PasswordField; import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class TextInputSample extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { stage.setTitle(VersionInfo.getRuntimeVersion()); stage.setScene(createScene()); stage.show(); } private Scene createScene() { HBox textAreaContainer = new HBox(4); TextArea textArea = new TextArea("Text A Text A\nText 1 Text 1"); textAreaContainer.getChildren().add(textArea); HBox textFieldContainer = new HBox(4); TextField textField = new TextField("Text B Text B Text 1 Text 1"); textFieldContainer.getChildren().add(textField); VBox root = new VBox(4); root.getChildren().add(textAreaContainer); root.getChildren().add(textField); return new Scene(root, 600, 400); } }