Key Events Handling Following is a Java program which handles key events. In the program when the user types characters in the text field, they are displayed in a label below the text field. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MyApplet extends JApplet implements KeyListener { JTextField jtf; JLabel label; public void init() { setSize(600,300); setLayout(new FlowLayout()); jtf = new JTextField(20); add(jtf); jtf.addKeyListener(this); label = new JLabel(); add(label); } public void keyPressed(KeyEvent ke){} public
The post How to handle Key Events in Deligation event model appeared first on Coding Security.
How to handle Key Events in Deligation event model
read more
Tidak ada komentar:
Posting Komentar