You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class JavaFxTest2 extends Application {
private final InlineCssTextArea textArea = new InlineCssTextArea();
private final VirtualizedScrollPane scrollPane = new VirtualizedScrollPane(textArea);
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
textArea.setWrapText(true);
textArea.setEditable(true);
textArea.setParagraphGraphicFactory(LineNumberFactory.get(textArea));
textArea.setPadding(new Insets(0, 0, 0, 0));
var ss = "Some text here";
VBox.setVgrow(scrollPane, Priority.ALWAYS);
VBox root = new VBox();
root.getChildren().addAll(scrollPane, new TextField());
textArea.setWrapText(true);
var css = this.getClass().getResource("console.css").toExternalForm();
var scene = new Scene(root, 450, 450);
scene.getStylesheets().add(css);
primaryStage.setScene(scene);
primaryStage.show();
textArea.appendText(ss);
}
}
Explanation: CSS is applied from least specific to most specific, with the most specific selector overriding the lesser.
Since the default CSS in "styled-text-area.css" for -rtfx-blink-rate is already highly specified as .styled-text-area .caret we need to use the Node Id specifier to override it.
This is java code:
This is css:
Caret seems to blink with the same rate, and with one pixel width. Is this correct behavior?
The text was updated successfully, but these errors were encountered: