Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to load an image?

 
Angela Stempfel
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
does anyone know how to load image with java WebStart?
i have the following helper class:
public class Util {
/** Creates new Util */
private Util() {
}
public static ImageIcon getImage(String fileName, Class loader) {
URL url = getURL(fileName, loader);
System.out.println("Icon URL -> "+url);
return (url == null) ? null : new ImageIcon(url);
}

public static URL getURL(String fileName, Class loader) {
System.out.println("filename -> "+fileName);
System.out.println("loader -> "+loader);
URL url = null;
if (fileName == null)
return null;
if (loader == null)
url = Util.class.getResource(fileName);
else
url = loader.getResource(fileName);
return url;
}
}
and with the following code i try to load the image:
public FirstAction() {
super("First", Util.getImage("/toolbarbuttongraphics/navigation/up24.gif", FirstAction.class));
vigation/up24.gif")));
}
but i i start the application with JWS i can't see the icons! i just see the text, which belong to the icon ( for example "FIRST").
can anybody help me?
thanks
angela
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic