title: FXML loader can't find .fxml file in the project with modules
body: <p>I have a project with such structure:</p>
  
  <p><a href="https://i.stack.imgur.com/YxJO4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YxJO4.png" alt="enter image description here"></a></p>
  
  <p>I trying to load sample.fxml from the Main class using this code: </p>
  
  <pre><code>Parent root = FXMLLoader.load(Main.class.getResource("../../submodule/src/java/sample.fxml"));
  </code></pre>
  
  <p>but it doesn't work. The sample.fxml file code is:</p>
  
  <pre><code>&lt;?import javafx.geometry.Insets?&gt;
  &lt;?import javafx.scene.layout.GridPane?&gt;
  &lt;?import javafx.scene.control.Button?&gt;
  &lt;?import javafx.scene.control.Label?&gt;
  
  
  &lt;GridPane fx:controller="sample.Controller"
        xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10"    vgap="10"&gt;
  &lt;/GridPane&gt;
  </code></pre>
  
  <p>The problem is that FXML loader can't find this location. How to solve it?</p>