package graphics.api.control.textbox; import javafx.application.Application; import javafx.scene.Group; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.*; public class TextFieldSizeIssue extends Application { public static void main(String[] args) { TextFieldSizeIssue.launch(args); } @Override public void start(Stage stage) throws Exception { double h = 400; double w = 400; TextField textbox; textbox = new TextField(); textbox.setText("Click on different position in the text and verify whether caret shows with blinking or not and also verify whether it overlaps on character or not"); textbox.setPrefColumnCount(12); textbox.setEditable(true); //textbox.setMultiline(true); Group group = new Group(); Scene scene = new Scene(group, w, h); ((javafx.scene.Group) scene.getRoot()).getChildren().clear(); ((javafx.scene.Group) scene.getRoot()).getChildren().addAll(textbox); stage.setScene(scene); textbox.setTranslateX(20.0); textbox.setTranslateY(20.0); textbox.requestFocus(); stage.setVisible(true); } }