Which HTML tags are supported in Swing components?

As @Mr.Napik notes in his answer, Swing HTML support was based on HTML 3.2, but it does support a few additional tags (notably <span>). The specific supported tags are documented in the HTML.Tag documentation.

CSS support is also detailed in the CSS documentation.


I don't know exactly what tags are supported, but I would suggest that you restrict yourself to bold/italics (or even better strong/em assuming it supports them) and img tags. Anything else is likely to cause headaches, and probably means you're stuffing too much into that component.


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.


I believe it's a narrow subset of HTML 3.x, although off the top of my head, I don't remember where I read that.

Tags:

Html

Java

Swing