This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Icons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Icons" Watch "Icons" New topic
Author

Icons

Karen Baog
Ranch Hand

Joined: Mar 02, 2005
Posts: 120
Hi all,

Trying to learn putting icons on buttons.
The icon shows when I run it, but the description is not shown.
Am I missing something?



amerzil co-ed student<br />"Praise be the Code"
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
What description? You haven't told the JButton which text you want it to display.


James Carman, President<br />Carman Consulting, Inc.
Karen Baog
Ranch Hand

Joined: Mar 02, 2005
Posts: 120
Hi James,

How do I add an icon and a description to the button?
I'm playing with the ImageIcon, thinking that the second argument will provide the description. I think I'm wrong here. Now, I don't know what to do.
Karen Baog
Ranch Hand

Joined: Mar 02, 2005
Posts: 120
I figured it out.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Icons
 
Similar Threads
running a class a particular number of times
Problems with ImageIcon in JButton
Image inside jar file
jbutton background image
Image as a button