【发布时间】:2014-10-27 13:06:18
【问题描述】:
这类似于Path for image file in Eclipse src folder, on a Mac 问题,我正在使用
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");
}
我所有的图像都在项目的 src 文件夹中。这在 Windows 上运行良好,但是当我将其导出为 jar 并在 MAC OS 上运行时,它会引发 File not found 异常。
【问题讨论】:
-
导出的 jar 文件是否包含 .jpg 和 .gif 文件?
-
@codeMan 是的。我已经检查过了。