title: How to add class or pseudoclass programmatically to custom control in JavaFX?
body: <p>In JavaScript world it is often set element class to denote it's appearance, which is later defined by CSS. </p>
  
  <p>Is this so in JavaFX?</p>
  
  <p>For example, what if I want to color negative value in red in <a href="http://docs.oracle.com/javase/8/docs/api/javax/swing/text/TableView.html" rel="nofollow"><code>TableView</code></a> cells? I would not <a href="https://docs.oracle.com/javafx/2/api/javafx/scene/control/Cell.html" rel="nofollow">code color directly</a>, but assigned some class to a cell, like "negative" and later would color it into red with <code>CSS</code>.</p>
  
  <p>I found <a href="http://download.java.net/jdk8/jfxdocs/javafx/css/PseudoClass.html" rel="nofollow"><code>PseudoClass</code></a> class. Is it intended for this? It is marked "since 8", so is there any more mature API for this?</p>