Preview HTML in Java

What libraries / methods that you know about can run some basic HTML representations in Swing? Can you comment on your experience?

+3
source share
7 answers

Many Swing controls (such as JLabel) can display basic HTML content. JEditorPane can be used to display HTML pages. However, these controls are limited to HTML 3.2 support .

For a richer experience, I would use JDesktop Integration Components .

JDIC Java , . Java. JDIC , , , , , JNLP ..

+1

Java JWebEngine. HTML 4 .

+2
+1

Swing , BasicHTML. , , .

+1

Java, IMO. , , HTML. JDIC , "" Swing.

, , Webait JWebPane , . , , (IceBrowser ).

+1

SwingBox, HTML- .

, BrowserPane JEditorPane, ( -).

The only problem I ran into was the unwanted scrollbars from the package JScrollPane. The demo application seems to have the same problem. I can’t say where this problem came from. I am using version 1.0.

Here's a snippet of code to show how easy it is to use the component:

BrowserPane browserPane = new BrowserPane();
JScrollPane scrollPane = new JScrollPane(browserPane);
someContainer.add(scrollPane);

browserPane.setText("<html><b>Some HTML here</b></html>");
// or...
browserPane.setPage(new URL("http://en.wikipedia.org"));
+1
source

Passed through a Lobo java browser the other day.

Lobo is actively developing with the goal of fully supporting HTML 4, Javascript, and CSS2.

There was no experience with him, but I thought that this could set you up.

0
source

Source: https://habr.com/ru/post/1696528/


All Articles