java网络五子棋的源代码(7) chatSocket.close(); } catch(Exception ed) { } } if(isOnChess isGameConnected) { try { chesspad.chessSocket.close(); } catch(Exception ee) { } } System.exit(0);
} if(e.getSource()==controlpad.joinGameButton) { String selectedUser=userpad.userList.getSelectedItem(); if(selectedUser==null selectedUser.startsWith("[inchess]") selectedUser.equals(chessClientName)) { chesspad.statusText.setText("必须先选定一个有效用户"); } else { try { if(!isGameConnected) { if(chesspad.connectServer(chesspad.host,chesspad.port)) { isGameConnected=true; isOnChess=true; isClient=true; controlpad.creatGameButton.setEnabled(false); controlpad.joinGameButton.setEnabled(false);