Ejemplo n.º 1
0
  public void keyTyped(KeyEvent e) {
    char code = e.getKeyChar();
    if (code == e.VK_ENTER) {
      //      if (dataField != null)
      {
        e.setKeyChar(e.CHAR_UNDEFINED);
        e.setKeyCode(-1);

        // only fire this event, if the data has been changed
        if (textField.isDataChanged()) {
          fireActionPerformed("enter");
        }

        // not shift + enter => focus to next
        if ((e.getModifiers() & e.SHIFT_MASK) != e.SHIFT_MASK) {
          this.changeFocusToNext();
        }
      }
    } else {
      if (!TKeyLock.keys.isLocked()) {
        textField.setDataChanged(true);
      }
    }
  }
Ejemplo n.º 2
0
 /** returns the status of data */
 public boolean isDataChanged() {
   return textField.isDataChanged();
 }