Skip to main content



      Home
Home » Newcomers » Newcomers » Loading Images in plug-in
Loading Images in plug-in [message #50636] Mon, 11 April 2005 11:19
Eclipse UserFriend
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.
Previous Topic:Incremental Build doesn't work
Next Topic:java.lang.UnsatisfiedLinkError
Goto Forum:
  


Current Time: Tue May 06 05:51:17 EDT 2025

Powered by FUDForum. Page generated in 0.10235 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top