IntelliJ IDEA - getClass().getResource(“…”) return null

前端 未结 9 720
挽巷
挽巷 2020-12-15 16:21

I\'m using IntelliJ IDEA 13.1.5, I used to work with Eclipse. I\'m working on JavaFX application, I try to load FXML file within my MainApp class using getClass().getResourc

9条回答
  •  悲哀的现实
    2020-12-15 16:51

    if your project is a maven project, check the target code to see whether your .fxml file exist there. if it's not there ,just add

    
            
                src/main/java
                
                    **/*.xml
                
                true
            
        
    

    in your pom.xml

提交回复
热议问题