addKeyListener. If you use
java.awt.TextArea for text input, add the following line to your code:
ta.addKeyListener(new AwtVietKey("Telex", ta, UnicodeEncoding.getInstance()));where ta is the TextArea. "Telex" is the input mode, you can also use "VNI" or "VIQR". The class AwtVietKey lies in the package
duc.util.gui and UnicodeEncoding in duc.util,
so these packages must be imported.
The implementation for Swing text components is duc.util.gui.SwingVietKey, so the way to add the driver to a JTextComponent (e.g., JTextArea or JTextPane) is:
ta.addKeyListener(new SwingVietKey("Telex", ta, UnicodeEncoding.getInstance()));
To use another encoding, construct the driver with that encoding, e.g.,
new SwingVietKey("VNI", ta, VISCIIEncoding.getInstance());