A
Aloys Oberthuer
Hello,
I am trying to load a .gif file from a JAR, and found the following way to do it
ClassLoader cl = this.getClass().getClassLoader();
Icon newIcon = new ImageIcon(cl.getResource("/images/icons/NewMan16.gif"));
// new ImageIcon(cl.getResource("images/icons/NewMan16.gif")); does not work either
The problem is, it does not work. The code is from class e.ar.Ear.someMethod(), the /images directory is top-level in
the JAR, i.e. the directory structure is as follows:
e/ar
images
properties
Strangely though, accessing the I18N files in directory /properties does work
ResourceBundle rbEarMenus = ResourceBundle.getBundle("properties/rb_Menus", getEarLocale());
strMnFile = rbEarMenus.getString("strMnFile");
what's wrong here,
Aloys
I am trying to load a .gif file from a JAR, and found the following way to do it
ClassLoader cl = this.getClass().getClassLoader();
Icon newIcon = new ImageIcon(cl.getResource("/images/icons/NewMan16.gif"));
// new ImageIcon(cl.getResource("images/icons/NewMan16.gif")); does not work either
The problem is, it does not work. The code is from class e.ar.Ear.someMethod(), the /images directory is top-level in
the JAR, i.e. the directory structure is as follows:
e/ar
images
properties
Strangely though, accessing the I18N files in directory /properties does work
ResourceBundle rbEarMenus = ResourceBundle.getBundle("properties/rb_Menus", getEarLocale());
strMnFile = rbEarMenus.getString("strMnFile");
what's wrong here,
Aloys