资源简介
JAVA+JSP程序系统的JSP聊天室
代码片段和文件信息
package org.jetic.web.chat;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import javax.swing.border.*;
import java.io.*;
import java.net.*;
public class Chatapplet extends Japplet {
boolean isStandalone = false;
BorderLayout borderLayout1 = new BorderLayout();
Border border1;
JPanel jPanel2 = new JPanel();
Border border2;
BorderLayout borderLayout2 = new BorderLayout();
JPanel jPanel1 = new JPanel();
JButton buttonSend = new JButton();
BorderLayout borderLayout3 = new BorderLayout();
JPanel jPanel3 = new JPanel();
Border border3;
BorderLayout borderLayout4 = new BorderLayout();
JTextField textTalk = new JTextField();
JPanel jPanel4 = new JPanel();
Border border4;
BorderLayout borderLayout5 = new BorderLayout();
JScrollPane jScrollPane1 = new JScrollPane();
JTextArea textMessages = new JTextArea();
PrintWriter out = null;
/**Get a parameter value*/
public String getParameter(String key String def) {
return isStandalone ? System.getProperty(key def) :
(getParameter(key) != null ? getParameter(key) : def);
}
/**Construct the applet*/
public Chatapplet() {
}
/**Initialize the applet*/
public void init() {
try {
jbInit();
Client client = new Client(this);
if (client.isConnected())
out = client.getOutputStream();
else
appendMessage(“大大的错误!!“);
}
catch(Exception e) {
e.printStackTrace();
}
}
/**Component initialization*/
private void jbInit() throws Exception {
border1 = BorderFactory.createEmptyBorder(9999);
border2 = BorderFactory.createEmptyBorder(9999);
border3 = BorderFactory.createEmptyBorder(2025);
border4 = BorderFactory.createEmptyBorder(0050);
this.setSize(new Dimension(400300));
this.getContentPane().setLayout(borderLayout1);
jPanel2.setBorder(border2);
jPanel2.setLayout(borderLayout2);
buttonSend.setFocusPainted(false);
buttonSend.setText(“发 送“);
buttonSend.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
buttonSend_actionPerformed(e);
}
});
jPanel1.setLayout(borderLayout3);
jPanel3.setBorder(border3);
jPanel3.setLayout(borderLayout4);
jPanel4.setBorder(border4);
jPanel4.setLayout(borderLayout5);
textTalk.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(KeyEvent e) {
textTalk_keyPressed(e);
}
});
this.getContentPane().add(jPanel2 BorderLayout.CENTER);
jPanel2.add(jPanel1 BorderLayout.SOUTH);
jPanel1.add(buttonSend BorderLayout.EAST);
jPanel1.add(jPane
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2001-01-20 12:11 classes\
目录 0 2001-01-20 12:11 classes\org\
目录 0 2001-01-20 12:11 classes\org\jetic\
目录 0 2001-01-20 12:11 classes\org\jetic\web\
目录 0 2001-01-20 12:11 classes\org\jetic\web\chat\
文件 736 2000-11-28 20:06 classes\org\jetic\web\chat\Chatap
文件 690 2000-11-28 20:06 classes\org\jetic\web\chat\Chatap
文件 5933 2000-11-28 20:06 classes\org\jetic\web\chat\Chatap
文件 1892 2000-12-06 18:22 classes\org\jetic\web\chat\ChatServlet.class
文件 1676 2000-11-28 20:07 classes\org\jetic\web\chat\Client.class
文件 1677 2000-11-22 17:35 classes\org\jetic\web\chat\ClientRecieveThread.class
文件 740 2000-11-22 13:46 classes\org\jetic\web\chat\Protocol.class
文件 3043 2000-11-28 20:07 classes\org\jetic\web\chat\Server.class
文件 2308 2000-11-22 14:00 classes\org\jetic\web\chat\ServerThread.class
文件 111 2000-02-11 10:56 classes\org\jetic\web\chat\k666说明1.txt
目录 0 2001-01-20 12:11 src\
目录 0 2001-01-20 12:11 src\org\
目录 0 2001-01-20 12:11 src\org\jetic\
目录 0 2001-01-20 12:11 src\org\jetic\web\
目录 0 2001-01-20 12:11 src\org\jetic\web\chat\
文件 4955 2000-11-28 20:06 src\org\jetic\web\chat\Chatap
文件 1153 2000-11-22 13:40 src\org\jetic\web\chat\ChatServlet.java
文件 976 2000-11-28 20:06 src\org\jetic\web\chat\Client.java
文件 1197 2000-11-22 17:34 src\org\jetic\web\chat\ClientRecieveThread.java
文件 278 2000-12-06 18:28 src\org\jetic\web\chat\jeticchat.jsp
文件 414 2000-11-22 13:37 src\org\jetic\web\chat\Protocol.java
文件 1871 2000-11-22 13:58 src\org\jetic\web\chat\Server.java
文件 1641 2000-11-22 14:00 src\org\jetic\web\chat\ServerThread.java
文件 111 2000-02-11 10:56 k666说明1.txt
- 上一篇:java写的网络围棋程序
- 下一篇:java足球游戏
评论
共有 条评论