jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes Buttons without clicking animation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Buttons without clicking animation" Watch "Buttons without clicking animation" New topic

Buttons without clicking animation

Gulshan Singh
Ranch Hand

Joined: Apr 22, 2009
Posts: 41
I'm making a battleship game, and I need to make a grid where the user can click to select where their ships are supposed to be and fire at enemy ships. Basically I need a button for each cell in the grid but not a button where it has the clicking animation, just a flat cell that puts a dot in the cell where the user clicked. Alternatively, I could have put a boundary on each cell and checked for a click in that boundary, but in an 8x8 grid, that is 64 boundaries to set. Sorry if that was hard to understand. If you don't understand just ask.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
try using a JLabel/MouseListener
I agree. Here's the link: http://aspose.com/file-tools
subject: Buttons without clicking animation
It's not a secret anymore!