Loading images from jars for Swing HTML

Without actually having tried it, I would assume that the HTML renderer can access your image if you include the resource URL in your HTML code:

String p = getClass().getResource("icons/folder_link.png" ).toString();
new JLabel("<html><table cellpadding=0><tr><td><img src="" + p + ""></td></tr><tr><td>100</td></tr></table></html>") );

Leave a Comment