M
M
mvd_19952014-03-21 21:49:17
Java
mvd_1995, 2014-03-21 21:49:17

Which swing component can accept formatting with html tags?

I need to output a large block of text read from an html file.
I originally wanted to use a JTextArea with a scroller, but it outputs unformatted text. What can be used instead or "customize" the JTextArea somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mvd_1995, 2014-03-21
@mvd_1995

I was able to find a solution myself: you need to use JEditorPane or its subclass JTextPane and specify ExamplePaneElement.setContentType("text/html");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question