Which HTML tags are supported in Swing components?

后端 未结 3 1132
清歌不尽
清歌不尽 2020-12-11 00:47

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 JEd

相关标签:
3条回答
  • 2020-12-11 01:27

    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.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-11 01:33

    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.

    0 讨论(0)
提交回复
热议问题