views:

351

answers:

4

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.

A: 

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.

Draemon
This is really a non-answer.
Software Monkey
I don't think so - I'm saying that although it probably "supports" more - it's unlikely to support it well, and I've made a suggestion as to what the real issue might be.
Draemon
I think this is a valid answer, I found this question through searching because I had the same question, and I think Draemon brings up a good point- "Anything else... probably means you're stuffing too much into that component."
instanceofTom
+1  A: 

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.

Rob
The Swing text component supports HTML 3.2 (Wilbur) and a reasonable subset of CSS 1.0.
Software Monkey
+1  A: 

As with most things with Swing, the best course of action is to look at the source.

Tom Hawtin - tackline
A: 

This guy feels your pain and is at least starting to collect his experiences:

http://retrovirus.com/brunch/2003/04/html-support-in-jeditorpane/

Allain Lalonde