Greetings!
I've been trying to display some HTML with Java using JEditorPane. But i've encountered a problem: it does not display any images.
I have a simple JFrame form with JButton and JEditorPane on it. Button has this click handler:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
String s = jEditorPane1.getText();
if (jEditorPane1.getContentType() == "text/html")
jEditorPane1.setContentType("text/plain"); else
jEditorPane1.setContentType("text/html");
jEditorPane1.setText(s);
}
This "converts" plain text to html and back when clicked. And this works perfectly for simple html. But when i try to show some images (giving image is inside directory with .jar i'm executing) i get image not found picture. The same happens when i put image inside my .jar.
So, the question is: How this could be fixed?
And one more to go: can i put some HTMLs with their files directories including inside my (or a new one) .jar and then show them up being loaded from that one? If so, how this can be done?