title: JavaFX loading a stylesheet
body: <p>JavaFX has a method that is added to the controller:<br>
  <code>public void initialize(URL url, ResourceBundle rb)</code></p>
  
  <p>This seems to run before any of the controls are added to the scene, because when I add this to it:</p>
  
  <pre><code>@Override
  public void initialize(URL url, ResourceBundle rb){
      String treeItemCss = getClass().getResource("/media/css/TreeItem.css").getPath();
      main.getScene().getStylesheets().add(treeItemCss);
  }
  </code></pre>
  
  <p>The CSS:</p>
  
  <pre><code>.tree-cell{
      -fx-indent: 100;
      -fx-underline: true;
  }
  </code></pre>
  
  <p>I get an error from this method: <code>getStylesheets()</code>. But if I move that to an <code>OnAction</code> and execute that action I get no errors.</p>
  
  <p>So my question is, is there a method that runs after all the controls are added to the scene, or a good way to add css to items that are created from a user action, such as a button click?</p>