0

I try to wite a Windows notepad applicatino with javafx.

In windows notepad, you can scale the text edit area, not to increase or decrease the font size. I tryed some ways to implement this function, but the result is not satisfying.

In my notepad applicatinon, I use a TextArea Control as the text edit area, and the TextArea is at the center part of a BorderPane.

Firstly, I tryed this

textArea.setScaleX(2);
textArea.setScaleY(2);

and this

Scale scale = new Scale();
scale.setPivotX(0);
scale.setPivotY(0);
scale.setX(2);
scale.setX(2);
textArea.getTransforms().add(scale);

However, the TextArea scale out the range of the BorderPane, so I can't see the input text and the scollbars.

I try to set the css of the TextArea

.text-area .text {
    -fx-scale-x: 2;
    -fx-scale-y: 2;
}

In this case, the text is scaled, but the caret not. So the caret is still at the original postion in origial size.

So, How to scale TextArea content in JavaFx, or scale the caret?

nooraLu
  • 1
  • 1

0 Answers0