-
Bug
-
Resolution: Unresolved
-
P3
-
jfx11, 8u20
ADDITIONAL SYSTEM INFORMATION :
openjdk 11.0.2 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.2+7)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+7, mixed mode)
javafx.version=11.0.2
javafx.runtime.version=11.0.2+1
javafx.runtime.build=1
A DESCRIPTION OF THE PROBLEM :
If a TextArea has its font changed the caret will not resize or relocate. This leaves the caret out-of-place until the user clicks somewhere on the TextArea.
TextField does not appear to have the same issue.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a TextArea with some text in it.
2. Change the Font of the TextArea (preferably with significant size difference).
3. If necessary, refocus the TextArea (don't click on TextArea) to display caret.
4. View incorrect caret.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The caret updates automatically to reflect the new text size and position.
ACTUAL -
The caret does not update until the user clicks on the TextArea.
---------- BEGIN SOURCE ----------
import javafx.animation.PauseTransition;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import javafx.util.Duration;
public class App extends Application {
@Override
public void start(Stage primaryStage) {
var area = new TextArea("Hello, World!");
area.positionCaret(3); // to make it easier to see
var delay = new PauseTransition(Duration.seconds(1.0));
delay.setOnFinished(e -> area.setFont(Font.font("System", 72.0)));
primaryStage.setScene(new Scene(area));
primaryStage.show();
area.requestFocus();
delay.play();
}
public static void main(String[] args) {
launch(App.class, args);
}
}
---------- END SOURCE ----------
FREQUENCY : always
openjdk 11.0.2 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.2+7)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+7, mixed mode)
javafx.version=11.0.2
javafx.runtime.version=11.0.2+1
javafx.runtime.build=1
A DESCRIPTION OF THE PROBLEM :
If a TextArea has its font changed the caret will not resize or relocate. This leaves the caret out-of-place until the user clicks somewhere on the TextArea.
TextField does not appear to have the same issue.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a TextArea with some text in it.
2. Change the Font of the TextArea (preferably with significant size difference).
3. If necessary, refocus the TextArea (don't click on TextArea) to display caret.
4. View incorrect caret.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The caret updates automatically to reflect the new text size and position.
ACTUAL -
The caret does not update until the user clicks on the TextArea.
---------- BEGIN SOURCE ----------
import javafx.animation.PauseTransition;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.TextArea;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import javafx.util.Duration;
public class App extends Application {
@Override
public void start(Stage primaryStage) {
var area = new TextArea("Hello, World!");
area.positionCaret(3); // to make it easier to see
var delay = new PauseTransition(Duration.seconds(1.0));
delay.setOnFinished(e -> area.setFont(Font.font("System", 72.0)));
primaryStage.setScene(new Scene(area));
primaryStage.show();
area.requestFocus();
delay.play();
}
public static void main(String[] args) {
launch(App.class, args);
}
}
---------- END SOURCE ----------
FREQUENCY : always
- relates to
-
JDK-8298494 TextArea: vertical scroll bar not updated when font changes
- Open
-
JDK-8314683 TextArea: scroll bar size and content padding
- Open
-
JDK-8307117 TextArea: wrapText property ignored when changing font
- Resolved
-
JDK-8089080 [TextArea] Caret disappear after pressing backspace to clear the content
- Open