Showing images in the components in Jbuilder
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Cat_t
Posted On:   Saturday, September 21, 2002 06:30 PM

Hi, does anyone know how to show images

in the JPanel using jbuilder? Because when I

run the file using JDK it works but when I run

it using Jbuilder it doesn't work.

Re: Showing images in the components in Jbuilder

Posted By:   fadi_shamma  
Posted On:   Wednesday, October 2, 2002 03:13 PM

hi


u can do it by tell jbuilder where the image that u want to use that by using the following code:


ImageIcon icon=ImageIcon([yourclass].class.getResource("[ImageName]"));

NOT


ImageIcon icon =new ImageIcon("[ImageName]");


shfad@hotmail.com

Re: Showing images in the components in Jbuilder

Posted By:   fadi_shamma  
Posted On:   Wednesday, October 2, 2002 03:02 PM


hi
u can do it by tell jbuilder where the image that u want
to use
that by using the following code:


ImageIcon icon=ImageIcon([yourclass].class.getResource("[ImageName]"));
NOT




shfad@hotmail.com


Re: Showing images in the components in Jbuilder

Posted By:   Sebastien_Meric  
Posted On:   Sunday, September 29, 2002 01:16 AM

Hello,


In JBuilder, like in most IDE, you choose the directory where the class should be put to. Default definition is :

/your_application_path/src
for your sources

/your_application_path/classes
for your classes


If so in your case, you should then add the images files to the JBuilder project ".jpx" so JBuilder knows it should copy them to the class directory.


Hop that helps

regards

S├ębastien

About | Sitemap | Contact