Java GUI question

NTB

Diamond Member
Mar 26, 2001
5,179
0
0
pardon the brainfart, but I cannot think of a good way to do this: I am trying to write a simple cardgame program, and so far I have a working deck of cards. However, to do anything with them, I have to push buttons. for dealing this isn't a problem, but for holding / discarding and stuff like that, I would like to make the cards clickable - I would eventually like to transfer what I've done as far as making the deck goes over to a solitaire-type game. Any ideas?

It's probably something obvious, but I'm drawing a blank :p

Nate
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
I haven't touched Java for more than a year, but I think you'll need to implement an ActionListener to listen to a mouse click event?

Might be completely wrong though :D
 

NTB

Diamond Member
Mar 26, 2001
5,179
0
0
Originally posted by: screw3d
I haven't touched Java for more than a year, but I think you'll need to implement an ActionListener to listen to a mouse click event?

Might be completely wrong though :D

that's what I was thinking; what I'm trying to figure out is the best way to do it. I have a class which defines *what* a card is - Rank, Suit, and ain image file; individual cards are declared (as card objects) from this.

Nate
 

NTB

Diamond Member
Mar 26, 2001
5,179
0
0


that looks exactly like what I need! too bad I have to pay to see it :(

edit: where'd the other links come from? you must've edited your post right as I clicked on the thread.
and another edit: thanks for the other links! I will look into the mouse-listener. I knew about using a button already; I was just curious about other ways to do it.

Nate
 

NTB

Diamond Member
Mar 26, 2001
5,179
0
0