import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.stage.Stage; import javafx.scene.control.TextField; import javafx.scene.layout.VBox; public class TextFieldInputMethodFX extends Application { public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 400,100); VBox vbox = new VBox(8); vbox.setSpacing(5); stage.setScene(scene); TextField tb1 = new TextField(""); tb1.setPrefColumnCount(40); tb1.setStyle("-fx-font: 24px SimSun;"); TextField tb2 = new TextField(""); tb2.setPrefColumnCount(40); tb2.setStyle("-fx-font: 24px SimSun;"); vbox.getChildren().addAll(tb1,tb2); root.getChildren().add(vbox); stage.setScene(scene); stage.show(); } public static void main(String[] args) { Application.launch(args); } }