服务端:
import .*;
import .*;
import .*;
public class ChatServer {
boolean stat = false;
ServerSocket ss = null;
Listclients = new ArrayList();tart(); }
public void start(){
try {
ss = new ServerSocket(8888);
stat = true;
} catch(BindException e){ tart();
(c); ;
import .*;
import .*;
public class ChatClient extends Frame {
Socket s = null;
DataOutputStream dos = null;
DataInputStream dis = null;
private boolean cont = false;
TextField tfTxt = new TextField();
TextArea taContent = new TextArea();
Thread tRecv = new Thread(new RecvThread());
public static void main(String[] args) {
new ChatClient().launchFrame();
}
public void launchFrame() {
setLocation(400, 300);
(300, 300);
add(tfTxt,;
add(taContent,;