• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't load images in SWT/Eclipse

 
Giomar Guevara
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing an Eclipse plugin (following an example I found on the net) and try to load small icons in a table. In my LabelProvider class I have this:

static {
String iconPath = "icons/";
imageRegistry.put(
CHECKED_IMAGE,
ImageDescriptor.createFromFile(
EbbTableViewer.class,
iconPath + CHECKED_IMAGE + ".gif"));

... more the same...

}

and here's the method that gets the image:

private Image getImage(boolean isSelected) {
String key = isSelected ? CHECKED_IMAGE : UNCHECKED_IMAGE;
return imageRegistry.get(key);
}

But no image is drawn. I got this error:

Unable to create resource File ImageDescriptor

Any ideas?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!