简体   繁体   中英

How to Set the Background Color of a Text Area Inside of a Scroll Pane?

I'm working on a PI approximation(using the infinite series) GUI, and I've run into a strange problem. In the JavaFX8 Scene Builder I set the background color to -fx-background-color: black; but when I start the program, the background is still white. The strange thing I've noticed is that the outline of the TextArea has turned black though. I've already checked for contradicting code that turns the background white again, but since I just started there can't be any. Stranger yet, the TextArea appears black in the preview of the program in the scene builder. The node graph can be seen in the first picture on the left.

EDIT: FXML(In this text file, I couldn't figure out how to post the code. I tried the blockquote, posting it normally, and trying the code literal tags): https://www.dropbox.com/s/4ic6n1vbsqqu7pg/FXML.txt

Text Area In Scene Builder: Scene Builder中的文本区域 Text Area Running: 文字区域正在运行

Sorry, a couple of years late..

.text-area .content 
{
    -fx-background-color: black;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM