🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #18843

����

#18843
From: ��
Date: Mon, 19 Jan 2004 13:12
47 lines
1625 bytes
��������,������ҵ�KeyAdapter��KeyPressed����û����ѽ
������ͨ���˵�
/*
 <APPLET
     CODE=applet2.class
     width=200
     height=200
  >
  </APPLET>

 */
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class applet2 extends Applet {

  public applet2() {
  }
  public void init()
  {
    setBackground(Color.white);
    TextField text1=new TextField(20);
    add(text1);
    text1.addKeyListener(new KeyAdapter()
    {
      public void KeyPressed(KeyEvent e)
      {
        //if (e.getKeyChar()=='a')
          setBackground(Color.black);
      }
    }
                        );

  }
  public void start()
  {

  }
  public void paint(Graphics g)
  {
    g.drawString("welcome to java",0,100);
  }

}
--

�� ��Դ:��Ʈ��ˮ�Ƽ� freecity.cnzju.net��[FROM: Shinjia]
Technical Details
Message-ID: <4AK2TU$9uK@freecity.cnzju.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!sjc70.webusenet.com!news.webusenet.com!news.bylinux.net!news.ccie.net.cn!Freecity

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,GB
X-Google-Thread: f6cb0,1cb79f93f4a6ce98,start
X-Google-Attributes: gidf6cb0,public
X-Google-ArrivalTime: 2004-01-19 05:13:17 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!sjc70.webusenet.com!news.webusenet.com!news.bylinux.net!news.ccie.net.cn!Freecity
From: Shinjia.bbs@freecity.cnzju.net (��)
Newsgroups: cn.bbs.comp.lang.java
Subject: ����
Date: 19 Jan 2004 13:12:51 GMT
Organization: Ʈ��ˮ�Ƽ�
Message-ID: <4AK2TU$9uK@freecity.cnzju.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: Java/M.1074517902.A
Lines: 47