java - Javafx Gridpane Cell Background Colors -
Then I have a JavaWiki program that processes the text nodes and incorporates them into the gridpan, each of these text The node has been given the CSS class. I used a stylesheet so that the cells of each class can be tried to make a different color. However, I can use only the -fx-fill property to change the text color, which is good, but as a way to change the background of each cell through CSS or Java I can not find anything online I have tried the property in the CSS fx-background-color , but it does not work any assistance will be appreciated; Thank you.
You field , or to set the background color> area
Either:
Use label instead of a text . You can set the background color with -fx-text-fill and -fx-background-color .
Or:
Create a stackpan for each text ; Add text to stackpan and stackpan to GridPane . You can set the text color from -fx-fill to text and background color with -fx-background-color StackPane . You will probably need to call
gridpan.setfill (myStackPane, true); Gridpan Setphilwath (mestackpan, true); To get GridPane to fill the stackpan for each cell, enter stackpay at .
Comments
Post a Comment