Hi, Dirk!
Here is an example that creates ImageIcon (it's swing) from gif.
The advantage is that /images/*.* is relative to CLASSPATH i.e.
you don't care about exact location and it also works fine if resources come
from jar. It is also platform-independent i.e. the same line of code
works fine on win.


theIcon = new ImageIcon(getClass().getResource("/images/test.gif"));


Andrey.



On 19-Nov-99 Dirk Waxweiler wrote:
> Hi everybody
> 
> I want to insert an Icon for my GUI. I get an Icon, but it ist a black
> point.
> 
> URL url = new URL("file:///./Brief.gif");
> Image icon = Toolkit.getDefaultToolkit().getImage(url);
> prog.setIconImage(icon);
> 
> Is my gif too big ?
> 
> MfG Dirk
>  
> ==========================================================
> Dirk Waxweiler
> incotech * 23,rue des Bruyères * L-1274 Howald/Luxembourg
> Tel.: +352 29 53 83 -1 * Fax: +352 29 53 83 222
> e-mail: [EMAIL PROTECTED] * internet: www.incotech.lu
> ==========================================================
> 
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

----------------------------------
E-Mail: [EMAIL PROTECTED]
Date: 22-Nov-99
Time: 14:17:14


Andrey.
----------------------------------


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to