• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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: 9401
181
  • 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: 9401
181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange, that should work. Can you write an SSCCE demonstrating the problem?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!