• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Netbeans Maven Get Resource As?

 
Greenhorn
Posts: 3
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 15490
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
com.protonmail.sarahszabo.simpleknisley.core.Main
 
Stephan van Hulst
Saloon Keeper
Posts: 15490
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Strange, that should work. Can you write an SSCCE demonstrating the problem?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic