On Thursday, 12 September 2013 at 11:23:51 UTC, Jacob Carlborg
wrote:
On 2013-09-12 12:31, Anton Alexeev wrote:
OK, thanks for the links!
First noob question:
I need an icon for the window. The Shell class has a method
setImage(Image image). In Java there is a SWTResourceManager
available:
shell.setImage(SWTResourceManager.getImage("/home/virtualbox/favicon.png"));
I've looked around a bit in *.di files and found an Image and
an
ImageLoader classes. Maybe it could work but I don't know how
to create
a Java String...
ImageLoader imageLoader = new ImageLoader();
Image image = new Image();
image.init_(imageLoader.load("/home/virtualbox/favicon.png"));
shell.setImage(image);
SWTResourceManager is not part of the standard SWT. It's seems
to be a part of WindowBuilder. Here's an example of how to set
the icon of a window:
http://www.java2s.com/Tutorial/Java/0280__SWT/Setleftuppercornerimage.htm
That site contains many other SWT tutorials as well.
Thanks a lot! One more question: how do I work with events?