Beispiel #1
0
 public void keyReleased(KeyEvent ke) {
   if (ke.getKeyCode() == KeyEvent.VK_UP) {
     String up = history.getUp();
     if (up != null) messageText.setText(up);
   } else if (ke.getKeyCode() == KeyEvent.VK_DOWN) {
     String down = history.getDown();
     if (down != null) messageText.setText(down);
   }
 }
Beispiel #2
0
 public void keyTyped(KeyEvent ke) {
   if (ke.getKeyChar() == KeyEvent.VK_ENTER) {
     sendMessage();
   }
 }