Im using JWebBrower.setHTMLContent() and its working fine for rendering HTML and external links.
Is it posisble tho to someone pass files using code so that they can be used in links/images..
for example, instead of needing an external link for a image on the page, is it possible to just use logo.jpg... and somehow pass that image into the browser in the same way setHTMLContent is used?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
Im using JWebBrower.setHTMLContent() and its working fine for rendering HTML and external links.
Is it posisble tho to someone pass files using code so that they can be used in links/images..
for example, instead of needing an external link for a image on the page, is it possible to just use logo.jpg... and somehow pass that image into the browser in the same way setHTMLContent is used?
Thanks
You can use navigate method to render images on your filesystem. JWebBrower.navigate("file:///logo.jpg");
Hi, Yeah I reliase that, however I want to serve up the html content to the user without needing to store tempory data on the filesystem
yes you can convert the image data to base64 and set as html content without need to any extra file or storage or file path etc.
img src="data:image/png;base64, iVBOR..rkJggg=="
Last edit: benchpresser 2022-03-02
awesome, this sounds perfect, thanks!