• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to load an image?  RSS feed

Angela Stempfel
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);
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));
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?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!