我想在 Java FX 文本区域内显示文本。
我的代码是:
TextArea txt = new TextArea();
txt.setEditable(false);
txt.setStyle("-fx-font-alignment: center");
txt.setText(text);
Run Code Online (Sandbox Code Playgroud)
但我无法设置文本对齐方式(在 内TextArea)
我试过这个:
txt.setStyle("-fx-font-alignment: center");
Run Code Online (Sandbox Code Playgroud)
但它没有用