易截截图软件、单文件、免安装、纯绿色、仅160KB

java简单聊天室

import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
public class Applet1 extends Applet implements ActionListener,ItemListener
{
  TextArea mainText;
    JTextField input;
    JButton sendButton,disconnectButton,connectButton;
    Checkbox secretCheck;
    Choice objChoice;
 String name="大家";
 public void init()
   { 
   mainText=new TextArea("",10,15);
  
  
      input=new  JTextField("",40);
      sendButton=new JButton("发送");
      sendButton.setForeground(Color.blue);
     
      disconnectButton=new JButton("断开连接");
      disconnectButton.setForeground(Color.blue);
      connectButton=new JButton("连接主机");
      connectButton.setForeground(Color.blue);
      secretCheck=new Checkbox("密谈");
      objChoice=new Choice();
   objChoice.add("大家");
      objChoice.add("little girl");
      objChoice.add("boy");
    this.setBackground(new Color(200,210,50));
    add(new ChatPanel());
 sendButton.addActionListener(this);
 objChoice.addItemListener(this);
   }
   public void actionPerformed(ActionEvent e)
 {
      
    mainText.append("你对"+name+"说:"+input.getText()+"\n");
    input.setText("");
    
       
 }
   public void itemStateChanged(ItemEvent e)
 {
       name=(String)e.getItem();
 }
class ChatPa


相关文档:

单的JAVA浏览器

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JFrame;
import j ......

java学习网址

1.Java学习网站:
Java中文世界论坛        http://www.chinajavaworld.com/index.jspa
Java世纪网              http://www.java2000.net/
Java 中文站            http://www.java-cn.com/
Java学习室      ......

JAVA开发者最常去的20个英文网站

1.[http://www.javaalmanac.com] – Java开发者年鉴一书的在线版本. 要想快速查到某种Java技巧的用法及示例代码, 这是一个不错的去处.
2.[http://www.onjava.com] – O’Reilly的Java网站. 每周都有新文章.
3.[http://java.sun.com] – 官方的Java开发者网站 – 每周都有新文章发表.
4.[http:/ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号