Loading Images in plug-in [message #50636] |
Mon, 11 April 2005 11:19 |
Eclipse User |
|
|
|
Originally posted by: flamereaver.yahoo.co.in
Hi all,
I'm writing a plug-in, and when I use the setImage function on a Shell
object, with a relative path like
objShell.setImage(objDisplay,"icons/pic1.gif");
I get a java.io.FileNotFoundException (due to the relative path). It works
properly for absolute paths.
How do I write a function in my plug-in that "accepts just the relative
path of the image and returns an Image object to it". The function should
be like...
import org.eclipse.swt.graphics.Image;
...
public static Image getImageFunction(Display display, String filename){
/*****************************
* return Image, on no error;
* null, otherwise
*****************************
*/
}
Thanks in advance,
Siv
P.S. For what is is worth!
1. All source files are inside a single package inside the 'src' directory
2. The icon files are not. They are in an 'icons' directory, at the same
level as the 'src' directory.
|
|
|
Powered by
FUDForum. Page generated in 0.10235 seconds