Package javax.swing

Examples of javax.swing.JFormattedTextField.commitEdit()


      if (controller != null) {
        // Add a listener to notify changes to controller
        textField.getDocument().addDocumentListener(new DocumentListener() {
            public void changedUpdate(DocumentEvent ev) {
              try {
                textField.commitEdit();
                controller.updateEditableProperty(editableProperty, textField.getValue());
              } catch (ParseException ex) {
                controller.updateEditableProperty(editableProperty, null);
              }
            }
View Full Code Here


        try {
          JFormattedTextField field = ((JFormattedTextField)component);
          field.requestFocus();
          field.setText(value);
          //launch an exception for invalid input
          field.commitEdit();
          //lose focus to format the value
          forceToLooseFocus(component);
          } catch (ParseException e) {
            // Invalid value in field
            //return false;
View Full Code Here

              // TF:08/06/2008:LIB-17:If this is a formatted field, we must use the getValue method,
              // otherwise we will potentially have formatting errors on masked fields.
              if (focusOwner instanceof JFormattedTextField) {
                JFormattedTextField formattedField = (JFormattedTextField)focusOwner;
                try {
                  formattedField.commitEdit();
                  //GK/DK: convert column index to a model index to set value
                  table.setValueAt(formattedField.getValue(), table.getEditingRow(), table.getEditingColumn());
                }
                catch (ParseException e) {
                  _log.error("Unhandled parse exception committing field edit: ", e);
View Full Code Here

              // TF:08/06/2008:LIB-17:If this is a formatted field, we must use the getValue method,
              // otherwise we will potentially have formatting errors on masked fields.
              if (focusOwner instanceof JFormattedTextField) {
                JFormattedTextField formattedField = (JFormattedTextField)focusOwner;
                try {
                  formattedField.commitEdit();
                  //GK/DK: convert column index to a model index to set value
                  table.setValueAt(formattedField.getValue(), table.getEditingRow(), table.getEditingColumn());
                }
                catch (ParseException e) {
                  _log.error("Unhandled parse exception committing field edit: ", e);
View Full Code Here

              // TF:08/06/2008:LIB-17:If this is a formatted field, we must use the getValue method,
              // otherwise we will potentially have formatting errors on masked fields.
              if (focusOwner instanceof JFormattedTextField) {
                JFormattedTextField formattedField = (JFormattedTextField)focusOwner;
                try {
                  formattedField.commitEdit();
                  //GK/DK: convert column index to a model index to set value
                  table.setValueAt(formattedField.getValue(), table.getEditingRow(), table.getEditingColumn());
                }
                catch (ParseException e) {
                  _log.error("Unhandled parse exception committing field edit: ", e);
View Full Code Here

    //of this method so that everything gets cleaned up.
    public boolean stopCellEditing() {
        JFormattedTextField ftf = (JFormattedTextField)getComponent();
        if (ftf.isEditValid()) {
            try {
                ftf.commitEdit();
            } catch (java.text.ParseException exc) { }
     
        } else { //text is invalid
            if (!userSaysRevert()) { //user wants to edit
          return false; //don't let the editor go away
View Full Code Here

  // of this method so that everything gets cleaned up.
  public boolean stopCellEditing() {
    JFormattedTextField ftf = (JFormattedTextField) getComponent();
    if (ftf.isEditValid()) {
      try {
        ftf.commitEdit();
      } catch (java.text.ParseException exc) {
      }

    } else { // text is invalid
      if (!userSaysRevert()) { // user wants to edit
View Full Code Here

  // of this method so that everything gets cleaned up.
  public boolean stopCellEditing() {
    JFormattedTextField ftf = (JFormattedTextField) getComponent();
    if (ftf.isEditValid()) {
      try {
        ftf.commitEdit();
      } catch (java.text.ParseException exc) {
      }

    } else { // text is invalid
      if (!userSaysRevert()) { // user wants to edit
View Full Code Here

  public boolean stopCellEditing() {
    JFormattedTextField ftf = (JFormattedTextField)getComponent()
    if (ftf.isEditValid()) {
      try {
        ftf.commitEdit();
      } catch (java.text.ParseException exc) { }

    } else { //text is invalid
      if (!userSaysRevert()) { //user wants to edit
        return false; //don't let the editor go away
View Full Code Here

        // of this method so that everything gets cleaned up.
        public boolean stopCellEditing() {
            JFormattedTextField ftf = (JFormattedTextField) getComponent();
            if (ftf.isEditValid()) {
                try {
                    ftf.commitEdit();
                } catch (java.text.ParseException exc) {
                }

            } else { // text is invalid
                if (!userSaysRevert()) { // user wants to edit
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.