changing JButton image upon clicking
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?