JAVA的即时通讯源代码.docJAVA实现即使通讯地代码图形界面
//////////////////////////////////////////////////////////
//用 Java 编写地聊天器,可以当服务器或者是客户端,一对一,自定义对方 IP 及端口.
//虽然名为 LANChat ,“服务器”.
///////////////////////////////////////////////////////////
import .*;
import .*;
import .*;
import .*;
import .*;
//////////////////////////////////////////////////////////
public class LANChatV12{
public static void main(String args[]){
LoginFrame lf = new LoginFrame("输入目标");
();
}
}
/////////////////////////////////////////////////////////
class LoginFrame extends JFrame{
JButton BOK;
JLabel LdesAddr, Lport;
JTextField TFdesAddr, TFport;
String desAddr, port;
LoginFrame(){}
LoginFrame(String title){
super(title);
Frame t = this;
BOK = new JButton("确定");
LdesAddr = new JLabel("目标 IP");
Lport = new JLabel("端口");
TFdesAddr = new JTextField(desAddr,12);
TFport = new JTextField(port,12);
//('*');
(new BOKListener(t));
setBackground();
setBounds(350,250,200,128);
setLayout(new FlowLayout(,5,7));
add(LdesAddr);
add(TFdesAddr);
add(Lport);
add(TFport);
add(BOK);
setResizable(false);
//setVisible(true);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
(0);
}
});
}
c
JAVA的即时通讯源代码 来自淘豆网m.daumloan.com转载请标明出处.