公安大学博士招生目录:简单的聊天室程序

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/01 11:27:03
import java.net.*;
import java.awt.*;
import java.swing.*;
import java.awt.event.*;
import java.util.GregorianCalendar;
import javax.swing.JDialog;

public class QQ extends Frame implements ActionListener{
Labe1 labe11=new Labe1("请输入你要发送的信息(英文!):");
Labe1 labe12=new Labe1("以下是你输入的信息记录:");
Labe1 labe13=new Labe1("把上面的信息发给以下IP地址:");
TextArea input=new TextArea(" ",7,14,TextArea.SCROLLBARS_BOTH); //创建和显示垂直和水平滚动条
TextArea input=new TextArea(" ",8,14,TextArea.SCROLLBARS_BOTH);
TextField IPAdd=new TextField("192.168.1.88");
Button send =new Button("发送信息");
Button about=new Button("关于");
Button clear=new Button("清空消息记录");
GregorianCalendar time =new GregorianCalendar();

QQ(){
super("效仿QQ聊天工具!");
SetLayout(null);
SetLocation(250,250);
this.setSize(518,218);
this.setResizable(false); //大小不可变
this.setBackground(new Color(220,220,220));
Toolkit kit=Toolkit.getDefaultToolkit();
Image myImage=kit.getImage("QQ.bmp");
this.setIconImage(myImage);

Labe11.setFont(new font("宋体",Font.PLAIN,12));
Labe12.setForeground(new color(0,0,192));
Labe13.setBounds(8,28,216,16);

input.setBackground(new Color(255,255,128));
input.setFont(new Font("Times New Roman",Font.BOLD,15));
input.setForeground(Color.magenta);
input.setBounds(8,44,248,120);

output.setBackground(new Color(128,255,255));
output.setFont(new Font("Times New Roman",Font.PLAIN,12));
output.setForeground(Color.magenta);
output.setBounds(264,44,248,136);
output.setEditable(false);

Send.setFont(new Font("新宋体",Font.PLAIN,12));
Send.setLocation(136,188);
Send.setSize(120,22);

Clear.setFont(new Font("新宋体",Font.PLAIN,12));
Clear.setLocation(392,188);
Clear.setSize(120,22);

Labe12.setFont(new Font("宋体",Font.PLAIN,12));
Labe12.setForeground(new Color(0,0,192));
Labe12.setBound(264,28,216,16);

about.setFont(new Font("新宋体",Font.PLAIN,12));
about.setLocation(264,188);
about.setSize(120,22);

Labe13.setFont(new Font("宋体",Font.PLAIN,12));
Labe13.setForeground(new Color(0,0,192));
Labe13.setBound(8,172,160,16);

IPADD.setFont(new font("新宋体",Font.PLAIN,12));
IPADD.setLocation(8,190);
IPADD.setSize(120,19);

add(labe11);
add(input);
add(labe13);
add(labe12);
add(output);
add(IPAdd);
add(send);
add(about);
add(clear);
addWindowListener(new closeWin());
Send.addActionListener(this);
about.addActioListener(this);
clear.addActionListener(this);
show();
waitForData();
}
接下条

回答:海底行

9月20日 13:41 多谢您的提议,我想百度客服部的人看到了肯定会引起重视的,您也可以跟他们联系
客服咨询邮箱:webmaster@vip.sina.com 咨询电话:010-82624488

什么啊,你想干什么,更我说吧