Results 1 to 3 of 3
Thread: Setting a picture on a button
- 09-25-2008, 05:17 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 1
- Rep Power
- 0
-
Easiest way? There's really one main way to do it (that I know of). Place the image in an ImageIcon, and then place the imageicon into the button using the setImageIcon(...) method. You will need to read and study the Sun Swing tutorials JButton section to learn how to do this best.
Good luck.
- 09-26-2008, 03:30 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
And on Suns' tutorial you can find the same example. At least study that example. You can find a lots of examples on the web too. :)
Similar Threads
-
how to import a picture into an applet
By cecily in forum Java AppletsReplies: 2Last Post: 01-15-2010, 08:51 PM -
how to display the picture when the filename is not in order
By norazanita in forum New To JavaReplies: 5Last Post: 06-06-2008, 09:31 AM -
Picture help
By deathnote11 in forum AWT / SwingReplies: 13Last Post: 06-03-2008, 05:46 PM -
Picture in a JFrame problem
By saytri in forum New To JavaReplies: 3Last Post: 01-12-2008, 09:44 AM -
Print a picture file
By oli001 in forum New To JavaReplies: 0Last Post: 11-26-2007, 01:40 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks