【发布时间】:2014-11-21 15:41:45
【问题描述】:
我正在尝试创建一个带有图像的按钮。该 API 可以在 here 找到。
这是我的代码:
Button settings = new Button(swpContainer, SWT.PUSH);
settings.setText("Settings");
settings.setImage(new Image(null, "/myProject/icons/settings.png"));
这是我得到的例外..
org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundException: \myProject\icons\settings.png (The system cannot find the path specified))
我在 Eclipse 中右键单击图像并从属性中获取路径。 任何帮助将不胜感激!
【问题讨论】:
标签: java eclipse eclipse-plugin