📄 listen.java
字号:
import java.io.*;import java.net.*;public class Listen extends Thread{ Socket socket; MainWindow mainWindow; public Listen(Socket socket,MainWindow mainWindow) { this.socket=socket; this.mainWindow=mainWindow; } public void run() { try { this.activeListen(this.socket); }catch(IOException ioe){this.mainWindow.panelGo.showError("意外中断");} } void activeListen(Socket socket) throws IOException { BufferedReader reader=new BufferedReader(new InputStreamReader(socket.getInputStream())); String message; while(true) { message=reader.readLine(); this.mainWindow.doMessage(message); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -