Q:

Java - Key Event Concept

0

This Program is used to demonstrate the Key Event Program.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

/* keyboard event */ 

import java.awt.*; 
import java.applet.*; 
import java.awt.event.*; 

public class keybo extends Applet implements KeyListener 
{ 
Label l; 
TextField t; 

public void init() 
{ 
l = new Label("enter the charecter : "); 
add(l); 

t = new TextField(10); 
t.addKeyListener(this); 
add(t); 
} 

public void keyPressed(KeyEvent e) 
{ } 

public void keyReleased(KeyEvent e) 
{ } 

public void keyTyped(KeyEvent e) 
{ 
showStatus("the given charecter is : "+e.getKeyChar()); 
} 
} 


/* <body> 
<applet code = "keybo.class" width = 200 height = 200> 
</applet> 
</body> */

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now