Results 1 to 2 of 2
  1. #1
    gruffyddd is offline Member
    Join Date
    Mar 2011
    Posts
    1
    Rep Power
    0

    Default Chess game selection screen

    I am making a chess game with Java. I am not tackling chess AI - the game simply enforces the rules of chess for two human players.

    Each chess square is a JLabel with a MouseListener which calls the squareClicked(clickedPosition) method in my GameController class. I have implemented almost the whole game of chess like this, but I'm now stuck when trying to implement one of the final features.

    When a pawn reaches the final square, I want a window to pop-up with some radio buttons so that the user can choose a replacement piece like a queen. It needs to work so that if the user tries to click on the chessboard whilst the window is still there, nothing should happen. Players should not be allowed to move until the replacement piece has been chosen.

    So the window needs to appear, the user should click a radio button for their desired piece, and then click ok. The window should then disappear, and my gamecontroller object needs to somehow be notified about their selection, so that it can replace the pawn with their selected piece and continue the game.

    I am not sure how to approach this. Sound like I may need to launch the window with a new thread, and join my main thread to the end of it. Or perhaps make my gamecontroller object wait(). However I am very inexperienced with threading and need some guidance.

    Thanks.

  2. #2
    rp181 is offline Member
    Join Date
    Mar 2009
    Posts
    70
    Rep Power
    0

Similar Threads

  1. Chess Game - Movement
    By danborgir in forum Advanced Java
    Replies: 1
    Last Post: 03-14-2011, 11:45 AM
  2. Java Game Expert Wanted to clone Chess.com
    By TOPSECRET in forum Jobs Offered
    Replies: 1
    Last Post: 04-28-2010, 03:20 AM
  3. chess game
    By michail in forum New To Java
    Replies: 13
    Last Post: 01-12-2010, 07:24 AM
  4. Chess game
    By michail in forum New To Java
    Replies: 4
    Last Post: 12-23-2009, 06:51 PM
  5. New Chess-Like game
    By jSarK0Y in forum Reviews / Advertising
    Replies: 3
    Last Post: 06-10-2009, 03: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
  •