Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which HTML tags are supported in Swing components?

Tags:

java

html

swing

Many Swing components support embedded HTML, but I cannot find any official documentation on that subject. (Everything on Sun's pages about HTML seems to be targeted at JEditorPane)

So: Which HTML tags are supported in Swing components?

EDIT: Although I said that I'm missing "official documentation", I'd also like any "unofficial" documentation.

like image 346
Daniel Rikowski Avatar asked May 16 '09 17:05

Daniel Rikowski


People also ask

Does Java Swing HTML?

The use of HTML is supported by most Swing components. For example, it is possible to use HTML markup to create multiline and multifont labels: JLabel label = new JLabel("<html>line 1<p><font color=blue size=+2>" + "big blue</font> line 2<p>line 3</html>");

Does JTextArea support HTML?

It has built in support for HTML. No how. Look for another component.


1 Answers

Swing supports HTML 3.2 (Wilbur) as Software Monkey said. You can find official documentation to this obsolescent (1996) version of HTML at: http://www.w3.org/TR/REC-html32.html

Java 7 documentation on the topic: http://docs.oracle.com/javase/7/docs/api/javax/swing/text/html/package-summary.html

Though it is worth of noting that it does not explicitly mention this information is valid for other Swing components.

like image 54
Mr. Napik Avatar answered Nov 09 '22 19:11

Mr. Napik