⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 3.java

📁 五子棋II小游戏
💻 JAVA
字号:
public void keyPressed(KeyEvent e) 
{ 
TextField inputWords=(TextField)e.getSource(); 
if(e.getKeyCode()==KeyEvent.VK_ENTER) 
{ 
if(inputpad.userChoice.getSelectedItem().equals("所有人")) 
{ 
try 
{ 
out.writeUTF(inputWords.getText()); 
inputWords.setText(""); 
} 
catch(Exception ea) 
{ 
chatpad.chatLineArea.setText("chessClient:KeyPressed无法连接,建议重新连接 \n"); 
userpad.userList.removeAll(); 
inputpad.userChoice.removeAll(); 
inputWords.setText(""); 
controlpad.connectButton.setEnabled(true); 
} 
} 
else 
{ 
try 
{ 
out.writeUTF("/"+inputpad.userChoice.getSelectedItem()+" "+inputWords.getText()); 
inputWords.setText(""); 
} 
catch(Exception ea) 
{ 
chatpad.chatLineArea.setText("chessClient:KeyPressed无法连接,建议重新连接 \n"); 
userpad.userList.removeAll(); 
inputpad.userChoice.removeAll(); 
inputWords.setText(""); 
controlpad.connectButton.setEnabled(true); 
} 
} 
} 
} 
public void keyTyped(KeyEvent e) 
{ 
} 
public void keyReleased(KeyEvent e) 
{ 
} 

public static void main(String args[]) 
{ 
chessClient chessClient=new chessClient(); 
} 
} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -