The JavaFX CSS style of textarea does not work
•
Java
I'm writing a simple JavaFX application, but I can't use some CSS styles
This is the relevant CSS:
.text-area { -fx-font-family: Consolas; -fx-highlight-fill: #00ff00; -fx-highlight-text-fill: #000000; -fx-text-fill: #00ff00; -fx-background-color: #000000; }
All fields execute as expected, except - FX background color, which obviously does nothing I still have the default white background As you can see in the picture, the textfield below has the same CSS, but the background color will be applied as expected
Picture of my problem
Any leads?
Solution
What you need to set:
.text-area .content{ -fx-background-color: black; }
…
Or the answer may be: transparent background of a textarea in JavaFX 8
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码