Home » Sometech » WAP in JAVA for handling key event.

WAP in JAVA for handling key event.

Java Coding

import java.awt.*;

import java.awtevent.*;

import java.applet.*;

public class Key11 extends Applet implements KeyListener

{

public void init();

{

addKeyListener(this);

}

public void keyPressed(KeyEvent e)

{

showStatus(“KeyPressed”);

setBackground(Color.red);

}

public void keyReleased(KeyEvent e)

{

showStatus(“KeyReleased”);

setBackground(Color.green);

}

public void keyTyped(KeyEvent e)

{

showStatus(“KeyTyped”);

setBackground(Color.blue);

}

}

/*<applet code=”Key11″   height=”500″   width=”800″>

</applet>*/

Advertisements

SoME Tech

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

%d bloggers like this: