This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi! Is there a way I can add an 'image' object to a container in an application? (not an applet)...... For ex., when i say: Container c = getContentPane(); c.add (img1); //img1 is an image object Error is generated. Can somebody suggest an alternative? As such, in my application, I need display images along with a button for each of the image....I am not able to figure out how to do this. Thanks for any help -S
This doesn't work because an Image is not a component. Only components can be added to containers. This is not a big problem, though... just extend a component like a Canvas or a Panel to take an Image, then in the paint() method of your new component, paint the image. Here's a really simple ( but functional ) example that extends Panel...
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Apr 30, 2001
Thanks a lot! once again!!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com