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
Expand|Select|Wrap|Line Numbers
- 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
Expand|Select|Wrap|Line Numbers
- 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