dcsimg
Is it possible to put Image on button using applet?if yes then how?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chandra_Shekhar
Posted On:   Tuesday, June 3, 2003 10:26 PM

I want to put the image on button and want to perform some activity in applet.could you help me in this if possible give one simple example.

Re: Is it possible to put Image on button using applet?if yes then how?

Posted By:   Narasimhan_Madhusudhanan  
Posted On:   Thursday, July 24, 2003 03:44 AM


hi..


yes, it is possible to put the image on the button, if u r using JButton. Use setIcon(ImageIcon);



sample code:



ImageIcon icon = new ImageIcon("d:....sample.gif");



JButton button = new JButton();



button.setIcon(icon);

button.setSize(icon.getWidth(),icon.getHeight());




Surely it will work.



Revert back, if you have any queries.



N.Madhusudhanan
About | Sitemap | Contact