public class ChatWindow extends WindowAdapter implements ActionListener { .............. .............. public void windowClosing(WindowEvent w){ try{ dos.flush(); frame.dispose(); isRunning =false; //t1.stop(); }catch(Exception oe){} } } class ReceiveMessage implements Runnable { .................. .................. public void run() { while(ChatWindow.isRunning) { try { while(true) { String str = dislocal.readUTF(); chatmodel.addElement(chatwith+":> "+str); } } catch(Exception e) { System.out.println("Error receiving message!"); } } } }
interrupt()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)