Olá pessoal,
Bom, estou tentando mostrar um arquivo html em um jeditorPane... se o arquivo for simples, ele é mostrado corretamente.... se tem figura, já não dah certo... =/
Estou fazendo da seguinte maneira:
jEditorPaneWelcome = new JEditorPane();
try {
insertHTML( jEditorPaneWelcome, "processoImpl2.html" );
} catch ( Exception e ) {
e.printStackTrace();
}
......
private void insertHTML( JEditorPane editor, String resourceName ) throws Exception {
// assumes editor is already set to "text/html" type
editor.setContentType( "text/html" );
HTMLEditorKit kit = ( HTMLEditorKit ) editor.getEditorKit();
Document doc = editor.getDocument();
Reader r = new InputStreamReader( this.getClass().getClassLoader().getResourceAsStream( resourceName ) );
doc.putProperty( "IgnoreCharsetDirective", new Boolean( true ) );
kit.read( r, doc, 0 );
} // Varia
Alguém sabe porque do erro? Ou saberia me indicar uma forma melhor de exibir arquivo html?
Muito obrigada
:wink:
Malu