I have a chess board that I would like to add a function to. When I get a pawn to the opposite side of the board I would like to swap it out for a different piece. I have a two dimensional array board,  being the first box, and  for the last. I also have a "captured" section, one for black, one for white. Captured pieces go there.
What I would like to use is a wait to allow a player to press the piece he/she would like back. Basically, I need a wait command of some type that will wait for one of the captured buttons to be pressed, only when a pawn to get the opposing side.
I think wait() - notify() will work, but I do not understand how to use them properly. I tried googling them, and looking in forums, to no avail.
Can anyone lend some insight?