I’m trying to load a local image into a JTextPane, and the program relentlessly displays a broken image icon. This is the HTML code:
<img src="file:\\C:\farmostrich.gif" width=77 height=777"/>
The program instantiates the JTextPane and displays the other parts of the html file (e.g. text, hyperlinks), but no image.
textPane = new JTextPane();
textPane.setContentType("text/html");
textPane.setText(htmlString);
Any suggestions? Thank you all so much!
I do like this: adding image into src folder