Scalafx and CSS Stylesheets
<p>I am creating a scalafx application and I cannot get it to communicate with an external stylesheet. I get a NullPointerException if I use </p>

<p>getClass.getResource </p>

<p>and if I do</p>

<p>stylesheets = "styles.css"</p>

<p>I get a message from sbt saying it cannot find my stylesheet. I have scoured the internet and tried to mimic what other projects have done but still have this same problem. Here is a portion of my code where I add the stylesheet. Both files are in the same directory.</p>

<pre><code>object Main extends JFXApp with toolbarComponent with menubarComponent {
  stage = new JFXApp.PrimaryStage {
    scene = new Scene(880, 520) {
      stylesheets = List(getClass.getResource("styles.css").toExternalForm)
...
}
</code></pre>

<p>My directory structure goes like this: </p>

<p>[Directory File] -> </p>

<p>src -> </p>

<p>main -> </p>

<p>scala, resources -> </p>

<p>Both files are in 'scala' directory.  </p>

<p>Any help is greatly appreciated.</p>