A
Abs
Hi!
I packaged my app in a signed JAR file and I can run it with no problems
from command line using:
java -jar myapp.jar
BUT, when I try running it with WebStart it fails to find its resources
(images, icons, etc.) which can be found inside the same JAR file. I
load them using the following line of code:
ImageIcon icon=new
ImageIcon(ResourceAnchor.class.getResource("icons"+System.getProperty("file.separator")+"icon.png")));
I tried the getClassLoader option, too:
ClassLoader loader=ResourceAnchor.class.getClassLoader();
ImageIcon icon=new
ImageIcon(loader.getResource("icons"+System.getProperty("file.separator")+"icon.png")));
But I get a NullPointerException. If I print this in the console:
System.out.println(loader.getResource("icons"+System.getProperty("file.separator")+"icon.png"));
I get "null" instead of the full image path as a result.
What am I doing wrong ?
Thanks in advance
I packaged my app in a signed JAR file and I can run it with no problems
from command line using:
java -jar myapp.jar
BUT, when I try running it with WebStart it fails to find its resources
(images, icons, etc.) which can be found inside the same JAR file. I
load them using the following line of code:
ImageIcon icon=new
ImageIcon(ResourceAnchor.class.getResource("icons"+System.getProperty("file.separator")+"icon.png")));
I tried the getClassLoader option, too:
ClassLoader loader=ResourceAnchor.class.getClassLoader();
ImageIcon icon=new
ImageIcon(loader.getResource("icons"+System.getProperty("file.separator")+"icon.png")));
But I get a NullPointerException. If I print this in the console:
System.out.println(loader.getResource("icons"+System.getProperty("file.separator")+"icon.png"));
I get "null" instead of the full image path as a result.
What am I doing wrong ?
Thanks in advance