I'm creating a JavaFX application that needs to show an image, my currently way to do that is this:
ImageView icon=new ImageView(new Image("file:///C:/Users/MMJon/eclipse-workspace/Pumaguia/src/vista/resources/rutas.png"));
i've tried to do it like this
ImageView icon=new ImageView(new Image(this.getClass().getResource("resources/rutas.png").toExternalForm()));
but it throws a Null Pointer exception. How can i do what i need?
Here's an image of the console and here's an image of my project's structure My main class is "pumaguia" and the class that shows the image is in "pestanas" package, and the folder that contains the image is "resources".
UPDATE: I've tried to compile on ubuntu's command line and this was what i get. Hope it helps.