wangting
2024-09-27 a3e87f78ee262ca9bb7d9b0c997639d5f3295890
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.vci.client.ui.swing.event;
 
import java.awt.event.KeyEvent;
 
import com.vci.client.ui.swing.components.VCIJTextField;
 
public class TestKeyListener extends VciKeyListener{
 
    public TestKeyListener(Object obj) {
        super(obj);
    }
 
    @Override
    public void keyTyped(KeyEvent e) {
        // TODO Auto-generated method stub
        
    }
 
    @Override
    public void keyPressed(KeyEvent e) {
        // TODO Auto-generated method stub
        
    }
 
    @Override
    public void keyReleased(KeyEvent e) {
        Object source = e.getSource();
        System.out.println("keyReleased");
        int keyCode = e.getKeyCode();
        if (keyCode == 10) {
            if (source instanceof VCIJTextField) {
                VCIJTextField text = (VCIJTextField) source;
                text.setText(text.getText() + "aa");
            }
        }
    }
 
}