Pages

Subscribe:

Blogger templates

Sample Text

Total Pageviews

Followers

About Us

My Photo
MY Name is Vicky. I am student in Univercity.Programming and webdesigning but i don't like Maths.Someone should kill the teacher .Besides i like writing stories ,and sciencefiction scripts .Soon i will have my book and a movie !!Like so much cooking & travelling all over the world an learn about other cultures! An artistic kid and art is my breath !

Thursday, July 16, 2009

WHICH KEY IS DOWN

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);
}
}

0 comments:

Post a Comment