问题
I am working on building a web browser in Java. I have used a parser (JTIDY) to parse the HTML page into a DOM document. I know that rendering means the graphical representation of DOM document. But I don't know what the engineering process is for HTML rendering in Java. In Java there is a JEditorkit to parse and render, but it is not well-formed. So I want a better solution.
My question is: what is the actual process of HTML rendering and showing the complete web page in Java?
回答1:
You can try either the Cobra renderer & parser or Flying Saucer project.
回答2:
There is the pretty much vaporware JWebPane that is part of JavaFX, but who knows when and if that will ever come out.
You can use MozSwing which integrates the Mozilla rendering framework with the Java Swing toolkit.
来源:https://stackoverflow.com/questions/4242757/how-do-you-render-html-using-java