I'm writing an application that displays "
playing cards". I have gif files for all the
cards, such as "aceclubs.gif", "sevendiamonds.gif", etc.
I'm displaying the cards using JLabel like this ...
JLabel fred = new JLabel("hello",
cardImageIcon,
JLabel.CENTER);
(where cardImageIcon is an image icon).
Now, when I press a button, I want to change
the card displayed to a different card.
Can't seem to do it. It seems that
Java lets
me change the text (i.e. "hello" to "goodbye")
but won't let me change my image from
"aceofhearts.gif" to "twospades.gif")
If not ImageIcon ... what should I use?
Should I use something other than JLabel?
Thanks!