DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2005

    Exclamation Java checkers game?

    Ok i'm making a java application that is the checkers game. I have a class for just the peices, it will know whether a peice can move and where, what to do when clicked, if its a king piece or not, and several other things. Well my question is how do i add each piece to the board so that when you click a piece it knows it's that object and not just the square u clicked in. As of right now i have a class to build the board and that's added to the content pane. If this isn't enough description let me know and i'll post the current code.

  2. #2
    Join Date
    Jul 2005
    SW MO, USA
    Could you use something like the Rectangle contains() method to detect if the click is on the image of a piece or not?
    Do you change the cursor when it's over a piece? Same problem.

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2006, 03:16 PM
  2. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 06:46 AM
  3. DevX does seem one sideded
    By Rob Abbe in forum Talk to the Editors
    Replies: 44
    Last Post: 01-13-2003, 02:57 PM
  4. learning c# very confusing.
    By Mike Tsakiris in forum .NET
    Replies: 11
    Last Post: 10-04-2002, 05:32 PM
  5. Re: VB vs. Visual Age for Java
    By JJ in forum Enterprise
    Replies: 1
    Last Post: 07-06-2000, 04:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center