public void setText ( Document doc , String text ) { StringReader reader = new StringReader ( text ) ; HTMLEditorKit kit = ( HTMLEditorKit ) m_editorPane . getEditorKitForContentType ( HTML_CONTENT ) ; try { int iLength = doc . getLength ( ) ; if ( iLength > 0 ) doc . remove ( 0 , iLength ) ; kit . read ( reader , doc , 0 ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; } catch ( BadLocationException ex ) { ex . printStackTrace ( ) ; } }
Set the control to this html text .