I need a method of rendering HTML in Java. I was originally planning to use WebKit for SWT, but I'm having problems with it displaying images as specified in the CSS.

Most examples I've seen have worked fine when loading an external html file, even the package mentioned above. My problem is I technically do not have an external document being used. The html code is generated in the application then passed to whatever object renders the page. Now the CSS file itself is external and I've changed the code in the HTML code to point to an absolute path. This helped a little, but images are still not loaded. I tried embedding the CSS into the HTML document and using absolute paths for all images, but that still didn't work.

Auto-generated HTML code + external CSS file = rendered in java

Any suggestions or package recommendations? I've also tried FlyingSaucer, but it had other limitations as well.

You might want to take a look at an open source browser in java called Lobo. Though it has a limited rendering capabilities when compared to browsers like Firefox, AFAICT, it's the best you can get with Java.

This article has been dead for over six months. Start a new discussion instead.