title: FXML: ClassNotFoundException
body: <p>I'm very new to <code>JavaFX</code> and I'm having problem using my custom class in <code>FXML</code>. The console keeps giving me this exception when trying to load <code>main.fxml</code>: </p>
  
  <pre><code>... 1 more
  Caused by: java.lang.ClassNotFoundException: sample.View$BoardPane
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  ...
  </code></pre>
  
  <p>I created <code>BoardPane</code> class as a subclass of <code>FlowPane</code> in package <code>sample.View</code> and referred to it in my FXML as the following: </p>
  
  <pre><code>&lt;?import sample.View.BoardPane?&gt;
  ...
  &lt;TitledPane expanded="true" collapsible="false" text="BoardPane" fx:id="centerTitledPane"&gt;
      &lt;BoardPane fx:id="mechoBoardPane"/&gt;
  &lt;/TitledPane&gt;
  ...
  </code></pre>
  
  <p>and the project structure looks like this: </p>
  
  <ul>
  <li>resources
  <ul>
  <li>fxml
  <ul>
  <li>main.fxml</li>
  </ul></li>
  </ul></li>
  <li>...</li>
  <li>src
  <ul>
  <li>...</li>
  <li>sample
  <ul>
  <li>...</li>
  <li>View
  <ul>
  <li>BoardPane</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>Can anyone please help me on this? I've been searching for some time and haven't found any explanation. </p>