title: JAVAFX: Is it possible to set css by code?
body: <p>I have the follow code:</p>
  
  <pre><code>.progress-bar &gt; .bar {
      -fx-background-color: linear-gradient(
      from 0em 0.75em to 0.75em 0px,
      repeat,
      -fx-accent 0%,
      -fx-accent 49%,
      derive(-fx-accent, 30%) 50%,
      derive(-fx-accent, 30%) 99%
  );}
  </code></pre>
  
  <p>Is it possible to set it by code? If yes, how to do that?</p>
  
  <p>I want to set by code because I want to solve another problem, <a href="https://stackoverflow.com/questions/22750164/javafx-progressbar-how-to-add-an-animation">click here</a></p>
  
  <p>One guy told me to use lookup get selector, but it return null.</p>
  
  <p>the following code is what I did? Could you tell me what's wrong?</p>
  
  <pre><code>Node bar = progress.lookup(".bar"); 
  </code></pre>
  
  <p>any help would be appreciated.</p>