public void columnSelectionChanged ( ListSelectionEvent e ) { if ( ! e . getValueIsAdjusting ( ) ) { int iColumn = m_jTableScreen . getSelectedColumn ( ) ; if ( iColumn != - 1 ) if ( m_thinTableModel != null ) // In case this was freed before I got the message { Convert converter = m_thinTableModel . getFieldInfo ( iColumn ) ; BaseApplet baseApplet = this . getBaseApplet ( ) ; if ( baseApplet != null ) { if ( converter instanceof FieldInfo ) baseApplet . setStatusText ( ( ( FieldInfo ) converter ) . getFieldTip ( ) ) ; else { TableColumnModel columnModel = m_jTableScreen . getTableHeader ( ) . getColumnModel ( ) ; TableColumn tableColumn = columnModel . getColumn ( iColumn ) ; TableCellEditor editor = tableColumn . getCellEditor ( ) ; String strTip = null ; if ( editor instanceof JComponent ) { String strName = ( ( JComponent ) editor ) . getName ( ) ; if ( strName != null ) { strName += Constants . TIP ; strTip = baseApplet . getString ( strName ) ; if ( strTip == strName ) strTip = baseApplet . getString ( ( ( JComponent ) editor ) . getName ( ) ) ; } } baseApplet . setStatusText ( strTip ) ; } String strLastError = baseApplet . getLastError ( 0 ) ; if ( ( strLastError != null ) && ( strLastError . length ( ) > 0 ) ) baseApplet . setStatusText ( strLastError ) ; } } } }
The column selection changed - display the correct tooltip .