public Object getControlValue ( ) { int iIndex = this . getSelectedIndex ( ) ; try { FieldTable table = m_record . getTable ( ) ; if ( m_strIndexValue != null ) if ( iIndex != 0 ) if ( table . get ( iIndex - 1 ) != null ) // I use get, so the index matches the index of JComboBox { FieldInfo field = m_record . getField ( m_strIndexValue ) ; if ( field == null ) field = m_record . getField ( 0 ) ; return field . getData ( ) ; } } catch ( Exception ex ) { ex . printStackTrace ( ) ; } if ( iIndex == 0 ) return null ; // None selected. return this . getSelectedItem ( ) ; }
Get this component s value as an object that FieldInfo can use .