我试图改变javafx-2中TextArea的背景和文本颜色.
myComponent = new TextArea();
myComponent.setStyle("-fx-text-fill: white;");
myComponent.setStyle("-fx-background-color: black;");
myComponent.setStyle("-fx-font: " + GUIConstants.SysResponseFont.getName());
myComponent.setStyle("-fx-font-family: " + GUIConstants.SysResponseFont.getFamily());
myComponent.setStyle("-fx-font-size: " + GUIConstants.SysResponseFont.getSize());
myComponent.setStyle("-fx-font-weight: " + GUIConstants.SysResponseFont.getStyle());
Run Code Online (Sandbox Code Playgroud)
此TextArea中的颜色和字体均未设置.我必须使用不同的方法吗?