I want to display a text inside a Java FX Text area.
My code is:
TextArea txt = new TextArea();
txt.setEditable(false);
txt.setStyle("-fx-font-alignment: center");
txt.setText(text);
But I'm not able to set a text alignment (inside the TextArea)
I tried this:
txt.setStyle("-fx-font-alignment: center");
But it didn't work