• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to load a image for jface's toolbar?

 
alex han
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
action is :

class SaveActionT extends Action {
ApplicationWindow window;

public SaveActionT(ApplicationWindow w) {
window = w;
setToolTipText("点击保存");
setImageDescriptor(ImageDescriptor
.createFromURL(Util.newURL(
"file:save.gif")));
}

public void run() {

}

}


and save.gif laid in x:\tomcat\webapps\myapp,now ,i want to move this file to x:\tomcat\webapps\myapp\WEB-INF\src\com\aztec\resources,but i dont't know how to modify

setImageDescriptor(ImageDescriptor
.createFromURL(Util.newURL(
"file:save.gif")));
file:save.gif --->change to what???
 
Bryce V.
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess at the moment is that the .gif file is in the same location as your source file. Which is why it works.

Have you tried applying the whole path to the location of the while, eg:



I could maybe seeing the compiler bitching about the 2 ":"'s, so i would also try putting the path in single quotes 'x:\' if the example above didn't work.

Yeah... i'm pretty much shooting at the hip here
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!