Home arrow static arrow Java Programming [Archive] - Insert Icon
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Insert Icon
This topic has 2 replies on 1 page.

Posts:32
Registered: 4/8/04
Insert Icon  
Jul 11, 2004 1:04 PM



 
How to use ImageIcon.Is it like
ImageIcon icon = new ImageIcon("picture.jpeg");
where should I put the picture.jpeg file
when I used it in JApplet It doesn't appear a picture
Help me
 

Posts:11,200
Registered: 7/22/99
Re: Insert Icon  
Jul 11, 2004 1:09 PM (reply 1 of 2)



 
Please see the 2how to use icons" page in the java tutorial: http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html

If you are writing applets, you shouldn't use the constructor that takes a string because that constructor tries to load the image from the local file system. But applets traditionally cannot read the local file system for security reasons so it's not going to work.
 

Posts:32
Registered: 4/8/04
Re: Insert Icon  
Jul 12, 2004 6:36 AM (reply 2 of 2)



 
thanks for the help
 
This topic has 2 replies on 1 page.