這類似於Path for image file in Eclipse src folder, on a Mac問題,我使用路徑爲在MAC OS Java的日食圖像
import org.eclipse.swt.graphics.Image;
public class Images {
static Image ICON_Search = new Image(App2.display, "src//search.jpg");
static Image ICON_RightArrow = new Image(App2.display, "src//right2.gif");
static Image ICON_LeftArrow = new Image(App2.display, "src//left4.gif");
static Image Background_White=new Image(App2.display,"src//whitebg.png");
}
我所有的圖片都在project.This的src文件夾在Windows上工作正常,但當我出口它作爲一個jar並在MAC OS上運行它會引發File not found異常。
輸出的jar文件是否包含.jpg和.gif文件? – codeMan 2014-09-03 06:26:45
@codeMan是的,我檢查過。 – user3873909 2014-09-03 06:31:42