public void focusLost ( FocusEvent e ) { m_componentNextFocus = null ; Component component = ( Component ) e . getSource ( ) ; String string = component . getName ( ) ; FieldInfo field = null ; if ( this . getFieldList ( ) != null ) field = this . getFieldList ( ) . getField ( string ) ; // Get the fieldInfo for this component if ( field != null ) { int iErrorCode = Constants . NORMAL_RETURN ; if ( component instanceof FieldComponent ) iErrorCode = field . setData ( ( ( FieldComponent ) component ) . getControlValue ( ) , Constants . DISPLAY , Constants . SCREEN_MOVE ) ; else if ( component instanceof JTextComponent ) iErrorCode = field . setString ( ( ( JTextComponent ) component ) . getText ( ) , Constants . DISPLAY , Constants . SCREEN_MOVE ) ; if ( iErrorCode != Constants . NORMAL_RETURN ) { field . displayField ( ) ; // Redisplay the old field value m_componentNextFocus = component ; // Next focus to this component } } }
When a control loses focus move the field to the data area .