package bug; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.TextArea; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class Bug extends Application { @Override public void start(Stage stage) throws Exception { final TextArea textArea = new TextArea(); textArea.setMaxHeight(50); String str = ""; for(int i=0; i< 15; i++){ str += "Line "+i+"\n"; } textArea.setText(str); VBox root = new VBox(); root.getChildren().addAll(textArea); Scene scene = new Scene(root,150,150); stage.setScene(scene); stage.show(); } }