You must use:
 
ImageIcon image = new ImageIcon(ClassLoader.getSystemResource("my.gif"))
 
Best regards ;-)
 
 
-------------------------------------------------------------
                 Jose Luis Rando Calvo
       Area de Investigaci�n y Desarrollo
       Estudio Inform�tica Software S.L.U.
             � � ----==== Grupo EI ====---- � �
-------------------------------------------------------------

>>> <[EMAIL PROTECTED]> 05/03 9:15  >>>
We are using JDK 1.1.8 for our application

we are now packing everything into a jar file for easier distribution,

we have some problems though with the retrieval of the images

they are in the root of the jar file

how do i create a new image icon

in an applet i would do  this
   ImageIcon imageIcon = new ImageIcon(new URL(getCodeBase(),"my.gif"));

but this is not working for an application. what is the equivalent to
getCodeBase()?

I know this must be a beginners question, but i think the documentation is
somewhat vague (or i haven't got the right books)

Thanks in advance

Peter Tilsted
Projekt Storkundel�nsomhed, 5094
tlf: +45 3333 4982
Email: [EMAIL PROTECTED]

_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to