|
java网络五子棋的源代码(28) statusText.setText("黑(第"+chessBlackCount+"步)"+chessPoint_a+" "+chessPoint_b+",请白棋下子"); isMouseEnabled=true; } else { this.add(chesspoint_black); chesspoint_black.setBounds(chessPoint_a*20-7,chessPoint_b*20-7,16,16); chessVictory(1); isMouseEnabled=true; } } else if(color==-1) { isWin=checkWin(chessPoint_a,chessPoint_b,color); if(isWin==false) { this.add(chesspoint_white); chesspoint_white.setBounds(chessPoint_a*20-7,chessPoint_b*20-7,16,16); statusText.setText("白(第"+chessWhiteCount+"步)"+chessPoint_a+" "+chessPoint_b+",请黑棋下子"); isMouseEnabled=true; } else { chessthread.sendMessage("/"+chessPeerName+" /victory "+color); this.add(chesspoint_white); chesspoint_white.setBounds(chessPoint_a*20-7,chessPoint_b*20-7,16,16); chessVictory(-1); isMouseEnabled=true; } } } public void mousePressed(MouseEvent e) { if (e.getModifiers()==InputEvent.BUTTON1_MASK) { chessPoint_x=(int)e.getX(); chessPoint_y=(int)e.getY();
|