title: How To Use CSS For JavaFX Projects
body: <p>I am quite new to JavaFX and was wondering if there is a way to assign a css file to the entire JavaFX project/scene.  Currently, I have to apply the stylesheet to every element I want to be styled with css.  I am working with IntelliJ and Scene Builder 2.0.  I have tried adding the stylesheets in my Main class, start method as shown below but it did not seem to have the desired effect.</p>
  
  <pre><code>public class Main extends Application {
  @Override
  public void start(Stage primaryStage) throws Exception {
      Parent root = FXMLLoader.load(getClass().getResource("JavaFXTest.fxml"));
      primaryStage.setTitle("JavaFX Test");
      primaryStage.setScene(new Scene(root, 300, 275));
      root.getStylesheets().add("@../styling/styles.css");
      primaryStage.show();
  }
  
  public static void main(String[] args) {
      launch(args);
  }
  </code></pre>