当前位置: 代码迷 >> Java相关 >> JAVA聊天室客户服务器连接问题 这里的this 是指向那的?
  详细解决方案

JAVA聊天室客户服务器连接问题 这里的this 是指向那的?

热度:86   发布时间:2006-09-28 08:17:21.0
JAVA聊天室客户服务器连接问题 这里的this 是指向那的?


//聊天室主类chatappletthree类
public class chatappletthree extends Applet implements Runnable,ActionListener,ItemListener
{public static final int PORT=1234; //port为网络套接字端口号
static String name,xingbie; //name,xingbie分别为聊天人的name sex
Socket socket;int jilu,enter=0;//jilu为新进入聊天室的人是否与已经有聊天室人员重名的标志
//jilu=0 表明无重名 jilu=1 表明有重名,应该重新输入名字
//enter为进入聊天室的标志, enter=1已经进入聊天室
//enter=0 表明未进入聊天室,发送按钮不起作用的
DataInputStream in; //定义读取服务器信息流in
static DataOutputStream out; //定义写入服务器信息流out
Thread thread;String line; //line 读取来自服务器线路的信息
static Apanel a;static Bpanel b;static Cpanel c;
static Mywindow mywindow; //mywindow为悄悄话窗口
//Applet启动初始化画出聊天室界面,建立与服务器连接
//Applet初始化
public void init()
{mywindow= new Mywindow();
setBackground(new Color(113,163,139));
setLayout(new BorderLayout ());
a=new Apanel();b=new Bpanel();c=new Cpanel();
add("North",a);add("Center",b);add("South",c);
a.button1.addActionListener(this);
a.button2.addActionListener(this);
c.button.addActionListener(this);
c.button2.addActionListener(this);
c.button3.addActionListener(this);
a.box1.addItemListener(this);
a.box2.addItemListener(this);
a.box3.addItemListener(this);
b.b2.list.addActionListener(this);
add("East",new Label());
add("West",new Label());
jilu=0;this.setForeground(Color.black);
c.msg_txt.setBackground(Color.white);
b.chat_txt.setBackground(new Color(200,185,220));
b.chat_txt.setFont(new Font("TimeRoman",Font.PLAIN,12));
}

[此贴子已经被作者于2006-9-28 9:14:05编辑过]

搜索更多相关的解决方案: JAVA  服务器  聊天室  客户  

----------------解决方案--------------------------------------------------------
  相关解决方案