public void changeFont ( boolean bDescription ) { if ( m_fontNormal == null ) { m_fontNormal = this . getFont ( ) ; m_fontDesc = m_fontNormal . deriveFont ( Font . ITALIC ) ; m_colorNormal = this . getForeground ( ) ; m_colorDesc = Color . gray ; } if ( bDescription ) { this . setFont ( m_fontDesc ) ; this . setForeground ( m_colorDesc ) ; } else { this . setFont ( m_fontNormal ) ; this . setForeground ( m_colorNormal ) ; } }
Change the font depending of whether you are displaying the description or text .