java - Change tree-cell selected font color in JavaFX -
i have javafx treeview , want change font color of selected cell black, make non-selected cell. (i tried setselectionmodel(null) throws errors.) cells have transparent background on background image, if matters.
css:
.tree-view, .tree-cell {     -fx-font: 20px "segoe print";     -fx-background-color: transparent; }  .tree-cell {     -fx-background-color: transparent;     -fx-padding: 0 0 0 0;     -fx-text-fill: #000000; }  .tree-cell:focused {     -fx-text-fill: #000000; }  .tree-cell:selected {     -fx-text-fill: #000000; }  .tree-cell .tree-disclosure-node {     -fx-background-color: transparent;     -fx-padding: 10 10 0 40; }  .button {     -fx-padding: 0 10 0 10; }   result: ("test4" selected)
this seems should set font color selected cells black, it's not happening. css file loaded , being used (the font correct, instance, , i've modified other things well), that's not issue.
if want transparent backgrounds , selected cells appear same non-selected cells, can do:
.tree-view {     -fx-text-background-color: black ;     -fx-background-color: transparent ;     -fx-selection-bar: transparent ; }      
Comments
Post a Comment