Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Netbeans Maven Get Resource As?  RSS feed

 
Greenhorn
Posts: 3
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using maven in netbeans and have imported a JavaFX project there. When I try to run getResourceAs, or this code:

      

I get an error. This is mysterious to me as I would think that (From what I've read on stackoverflow on this system, it loads files from where the classes are in the jar. Since the .fxml file is in the same package it should load it, bu instead it prints null.

Am I doing something wrong?

Directory of the project folder (In the attachments section)
Screenshot_20180615_013802.png
[Thumbnail for Screenshot_20180615_013802.png]
Directory
 
Saloon Keeper
Posts: 8892
166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give the fully qualified name of the class you're calling that code from?
 
Sarah Szabo
Greenhorn
Posts: 3
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
com.protonmail.sarahszabo.simpleknisley.core.Main
 
Stephan van Hulst
Saloon Keeper
Posts: 8892
166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange, that should work. Can you write an SSCCE demonstrating the problem?
 
it's a teeny, tiny, wafer thin ad:
free 1 hour java lesson
https://coderanch.com/t/695988/free-hour-java-lesson
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!