dcsimg
How to add the Image in Button
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   subash_chandrabose
Posted On:   Wednesday, May 24, 2006 05:51 AM

Dear Friends ;

I have to add the image on Button(awt component).
can u help me

Re: How to add the Image in Button

Posted By:   Robert_Lybarger  
Posted On:   Wednesday, May 24, 2006 07:25 AM

The standard AWT "Button" has no special provisions for Image that I can see in the docs. It does, however, have all methods provided in Component. You will likely need to subclass Button and override a few methods (like paint(Graphics g), for example) to do custom rendering. There are tutorials and guides on the internet that discuss custom widgets that should guide you. It generally isn't too hard to get working; some of the trickier aspects of custom widgets are getting them to play nicely with layout managers, at least from my now-distant experience.
About | Sitemap | Contact