import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.scene.control.TextField; /** * Demonstrates a TextField control that allows you to enter text. * * @see javafx.scene.control.TextField */ public class TextFieldSample extends Application { private void init(Stage primaryStage) { Group root = new Group(); primaryStage.setScene(new Scene(root, 400,100)); TextField tb = new TextField("Hello"); root.getChildren().add(tb); } public double getSampleWidth() { return 400; } public double getSampleHeight() { return 100; } @Override public void start(Stage primaryStage) throws Exception { init(primaryStage); primaryStage.show(); } public static void main(String[] args) { launch(args); } }