Error loading fxml files from a folder other than the bin folder

后端 未结 3 897
天命终不由人
天命终不由人 2020-12-06 23:14

I am a fairly new java programmer. I only have about five weeks of experience, starting from zero, and I am having problems getting javafx fxml files created in Scene Builde

3条回答
  •  有刺的猬
    2020-12-06 23:24

    Both exceptions say "the (FXML) file you are trying to load cannot be found in the location you have provided". Your filename is wrong or its path. Give your package structure or at least the path of class file that includes load(String pFileName, Stage pStage, String pTitle) method and the path of FXML file you want to load. Read the javadoc API of getResource() and examine sample codes about it on the net.

提交回复
热议问题