• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to change background color of selected TreeCell?

 
Volodymyr Lysenko
Ranch Hand
Posts: 511
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

I have read already about Cell here.
They say if you want to change background color of selected TreeItem you need to use :

I tried list-cell, tree-cell and my own selector and all does not work.

How to change background color of selected tree cell?

Thnaks!
 
Volodymyr Lysenko
Ranch Hand
Posts: 511
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It started to work. Probably eclipse did not recompile it all
 
Josh Bodily
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the documentation on the link you provided:

Following are a number of key use cases used to drive the Cell API design, along with code examples showing how those use cases are satisfied by this API. This is by no means to be considered the definitive list of capabilities or features supported, but rather, to provide some guidance as to how to use the Cell API. The examples below are focused on the ListView, but the same philosophy applies to TreeCells or other kinds of cells.


So, you should use the ".tree-cell" selector, not the ".list-cell" selector to style cells of a TreeView.

Complete CSS reference here:
JavaFX CSS Reference
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic