Results 1 to 3 of 3
- 12-21-2010, 12:07 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 2
- Rep Power
- 0
changing JButton image upon clicking
Hello,
I want to have a JButton's image change when it it clicked. I don't want it to just change for the click, but to remain the changed picture after the click. So I'm not looking for a method like "setPressedIcon." I would think that I could change the image by using setIcon in the action listener when the button is pressed, but it wasn't working. When I tried doing that, the picture just disappeared when I clicked the button and then after there was no picture at all. Is there something I'm missing? Or a better way to approach this?
Thanks.
-
Yeah, we need to see code to see where your mistakes are, otherwise it will be difficult to help you. Please look at my link on how to create an SSCCE to see just what type of code we need to see.
- 12-21-2010, 02:53 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
How to show the full resolution image at clicking on thumnail
By amritpalpathak in forum New To JavaReplies: 4Last Post: 12-01-2010, 04:43 PM -
Changing binding when changing the underlying model object
By ChrisNY in forum NetBeansReplies: 0Last Post: 08-14-2010, 10:09 AM -
Changing colors of an image in real time
By chale in forum CLDC and MIDPReplies: 0Last Post: 05-06-2009, 03:04 PM -
adding Image to JButton
By mayhewj7 in forum New To JavaReplies: 3Last Post: 03-31-2009, 03:39 AM -
Changing images by clicking arrow buttons. help?
By ashton in forum New To JavaReplies: 3Last Post: 02-08-2009, 11:29 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks