Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing Jbutton Icon

Status
Not open for further replies.

bos

Technical User
Oct 1, 2002
50
0
0
US
I have a jbutton with an imageicon. I'd like the image to change when the button is clicked. How do I put in the new image? Thanks in advance.
 
Hi bos,

Check out the setIcon() method of JButton's superclass, javax.swing.AbstractButton. This should do the trick.

Best,
Adam Rice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top