How to add class or pseudoclass programmatically to custom control in JavaFX?
问题 In JavaScript world it is often set element class to denote it's appearance, which is later defined by CSS. Is this so in JavaFX? For example, what if I want to color negative value in red in TableView cells? I would not code color directly, but assigned some class to a cell, like "negative" and later would color it into red with CSS . I found PseudoClass class. Is it intended for this? It is marked "since 8", so is there any more mature API for this? 回答1: If you want to add a style to a Node