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

前端 未结 9 721
挽巷
挽巷 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 17:00

    For those who use Intellij Idea: check for Settings -> Compiler -> Resource patterns.

    The setting contains all extensions that should be interpreted as resources. If an extension does not comply to any pattern here, class.getResource will return null for resources using this extension.

提交回复
热议问题