• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding Image to a button

 
chander shivdasani
Ranch Hand
Posts: 206
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to add an Image to a button once a button is pressed. To do that, i am using the following code:



The Problem is, whenever i am using setPressedIcon it does not display the image, but when i replace it by setIcon, it works.But i have to diable the button once it is pressed, so i do setEnabled(false), which changes the color of the image

How do i do this?
 
Maneesh Godbole
Saloon Keeper
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out AbstractButton#setDisabledIcon()
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this link:

BeForthrightWhenCrossPostingToOtherSites
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic