• 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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: 9138
172
  • 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: 9138
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange, that should work. Can you write an SSCCE demonstrating the problem?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!