The caret position changed using arrow keys or mouse cursor is also reversed by undo operation.
Execute below program & move cursor using arrow keys & press Ctrl+Z.
The cursor position will be reverted.
-----------------------------------------------------
Sample to check:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class App extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
TextArea control = new TextArea("1 2 3 4 5 6 7 8 9 10");
Scene scene = new Scene(new VBox(control), 500, 500);
stage.setScene(scene);
stage.show();
}
}
Execute below program & move cursor using arrow keys & press Ctrl+Z.
The cursor position will be reverted.
-----------------------------------------------------
Sample to check:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class App extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
TextArea control = new TextArea("1 2 3 4 5 6 7 8 9 10");
Scene scene = new Scene(new VBox(control), 500, 500);
stage.setScene(scene);
stage.show();
}
}
- relates to
-
JDK-8165795 TextArea/TextField: undo works incorrectly
-
- Closed
-