如何改变窗口左上角显示的标题图像?
写了下面的代码后没有任何变化,标题图像还是以前默认那个。(图像已导入icons文件夹) public void open() {
final Display display = Display.getDefault();
createContents();
Image windowIcon = new Image(display, "icons/timeiconsmall.jpg"); //add icon
shell.setImage(windowIcon); //add icon
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
windowIcon.dispose();
display.dispose();
}
写了下面的代码后没有任何变化,标题图像还是以前默认那个。(图像已导入icons文件夹) public void open() {
final Display display = Display.getDefault();
createContents();
Image windowIcon = new Image(display, "icons/timeiconsmall.jpg"); //add icon
shell.setImage(windowIcon); //add icon
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
windowIcon.dispose();
display.dispose();
}
setIconImage((new ImageIcon("*.jpg")).getImage())
shell.setImage(SWTResourceManager.getImage(face.class, "icons/eclipse0.gif"));