mport java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
public class Keyboard1 extends Applet implements KeyListener
{
String s;
char c;
public void init(){
addKeyListener(this);
requestFocus();
}
public void keypressed(KeyEvent e)
{
s=e.getKeyText(e.getKeyCode());
showStatus("patithike to :"+s);
}
public void keyReleased(KeyEvent e){
s=e.getKeyText(e.getKeyCode());
showStatus("KEY IS :"+s);
}
public void keyTyped(KeyEvent e){
c=e.getKeyChar();
s=String.valueOf(c);
showStatus("KEY IS :"+s);
}
}
Thursday, July 16, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment