Results 1 to 3 of 3
  1. #1
    mofaghih is offline Member
    Join Date
    Jul 2011
    Posts
    2
    Rep Power
    0

    Default chess game! plz help!

    I'm going to program a 2 player chess game..
    it would be too simple! even not use mouse!
    where should i start!?
    I started a little, but now it seems to be unusable..
    My problem is , using jLabels..
    for moving, it get the coordinate and move the jLabel by .setLocation();
    I don't now if use jLabel in a class for example pawn, and then when NEW a class a jLabel be newed in it or NOT..?
    is it correct or I'm going the wrong way!?
    plz help me!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    One simple solution is to not move any components at all. Instead make a 2D grid of JLabels, say placed in a JPanel that uses GridLayout(8, 8), and rather than change JLabels, if you want to "move" a piece, simply change the ImageIcon held by involved the JLabels.

  3. #3
    mofaghih is offline Member
    Join Date
    Jul 2011
    Posts
    2
    Rep Power
    0

    Default how!?

    Quote Originally Posted by Fubarable View Post
    One simple solution is to not move any components at all. Instead make a 2D grid of JLabels, say placed in a JPanel that uses GridLayout(8, 8), and rather than change JLabels, if you want to "move" a piece, simply change the ImageIcon held by involved the JLabels.
    I got it, but how can I make a Jpanel witch uses GridLayout(8,8) ???
    I had done it with drawing rectangles !!
    Ur solution seems to be better but how!?

Similar Threads

  1. Chess game selection screen
    By gruffyddd in forum AWT / Swing
    Replies: 1
    Last Post: 03-19-2011, 04:27 AM
  2. Chess Game - Movement
    By danborgir in forum Advanced Java
    Replies: 1
    Last Post: 03-14-2011, 12:45 PM
  3. chess game
    By michail in forum New To Java
    Replies: 13
    Last Post: 01-12-2010, 08:24 AM
  4. Chess game
    By michail in forum New To Java
    Replies: 4
    Last Post: 12-23-2009, 07:51 PM
  5. New Chess-Like game
    By jSarK0Y in forum Reviews / Advertising
    Replies: 3
    Last Post: 06-10-2009, 04:28 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
  •