• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to load an image?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic