Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void addKeyListeners() {
- this.addKeyListener(
- new KeyListener() {
- @Override
- public void keyTyped(KeyEvent e) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
- @Override
- public void keyPressed(KeyEvent e) {
- inputField.setText(inputField.getText() + String.valueOf(e.getKeyChar()));
- }
- @Override
- public void keyReleased(KeyEvent e) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
- }
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment