Buttons! Buttons?

I'm building a checkers game as a self exercise, and I've run into some fun with defining the board

64 JPanels for board squares within a Container as the board works pretty well visually. However, I can't addActionListener to a JPanel. I thought about adding the listener to the pieces themselves, which works fine and dandy until you try to just move a piece to an empty space. You can't, because clicking the space doesn't proc an action.

So I can't use JPanels, and I can't use the pieces themselves. I COULD make the board a set of buttons, but the buttons change color and look funny when you click them.

My question: is there a way to change the button faces and/or the way they react to being clicked?

OR

Any ideas for what I could use as board squares or for a board setup that would allow the clicking/action prompting I need?

[880 byte] By [Hybrida] at [2007-11-27 8:34:56]
# 1

You could use MouseListeners on the panels, but you'd have to do some extra work to get the mouse clicks to behave the same way as they do on a button (being able to move the mouse between pressing and releasing). Basically, if the mouse exits the component between press and release, it doesn't count as a click. You wouldn't have to do that, but it's frustrating having to hold the mouse still when clicking.

hunter9000a at 2007-7-12 20:31:19 > top of Java-index,Java Essentials,New To Java...
# 2
Ooo, mouse listeners used to be my best friend in VB, I never stopped to wonder if Java had them.I'm kind of a fan of the click twice play style anyway, so drag and drop isn't a big concern.Thanks for the tip!
Hybrida at 2007-7-12 20:31:19 > top of Java-index,Java Essentials,New To Java...
# 3
i suggest not using 64 jpanels, use 1. one mouse listener, get x,y and figure out what square they clicked in.if you are smart, you can even paint the checkerboard correctly with ONE loop.
mkoryaka at 2007-7-12 20:31:19 > top of Java-index,Java Essentials,New To Java...