Please help me!
I have two JFrames: ChessBoard and PawnPromotion. PawnPromotion is launched from ChessBoard, and when it is operating I call wait() on ChessPromotion. After user selects piece in PawnPromotion it calls notify() in ChessBoard and exits.
this is the code in ChessBoard
This is the code in PawnPromotion when selection done.
mc is the ChessBoard from which it was launched
Unfortunately it doesn't work well.Strangely enough it works sometimes, I can't understand what conditions cause it to work,but usually it doesn't work.
Additional information: this is part of larger program,it is not possible for me to post all the code.
I would be very thankful for suggestions here.
Val
I have two JFrames: ChessBoard and PawnPromotion. PawnPromotion is launched from ChessBoard, and when it is operating I call wait() on ChessPromotion. After user selects piece in PawnPromotion it calls notify() in ChessBoard and exits.
this is the code in ChessBoard
Code:
PawnPromotedSelection pps=new PawnPromotedSelection(this,father_board,from);
synchronized(this)
{
try{ this.wait();}catch (Exception e){}
}
This is the code in PawnPromotion when selection done.
mc is the ChessBoard from which it was launched
Code:
synchronized(mc){mc.notify();}
this.dispose();
Additional information: this is part of larger program,it is not possible for me to post all the code.
I would be very thankful for suggestions here.
Val
Comment