Compiling the hello world example fails (2)

Jacob Carlborg doob at me.com
Thu Sep 12 04:23:50 PDT 2013


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.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-dwt mailing list