是否可以制作JEditorPane
了解更高级的 HTML 和 CSS?
我的意思是,当您输入 HTML 或 CSS 时,例如 <button>
, <progress>
,或大多数其他标签,它无法理解它们。有没有办法让它理解并显示更复杂、更高级的编码?如果是的话我该怎么做?
谢谢!
最佳答案
是的。 Java 7 EE 具有 HTML5 功能,尽管我不确定具体的标签。另外,还有外部包,例如 one from Intel freely available并且您始终可以自己以某种方式扩展功能。
编辑:我的第二个建议的附录(实现链接问题中的主题)
Intel JWebEngine(这可能是您已经在寻找的)文档说:
What are the advantages versus the built-in Java HTML editor?
The built-in Java HTML editor of Java is very limited. It only supports HTML 3.2 with some features of HTML 4 and CSS. The support of CSS is wrong in many cases, especially when it comes to cascading selectors. The text is often too small and on many web sites Java only shows an error instead of a incorrectly formatted page.
Here are some further differences:
- JWebEngine can display the ACID 1 test correctly - Java does not
- JWebEngine can display the ACID 2 test partly - Java only displays a blank page because an error occurs
- JWebEngine basically shows HTML pages like a browser with JavaScript disabled
- In cases where the CSS and HTML specifications are not explicit about implementation JWebEngine is designed to mirror Mozilla FireFox's behavior.
关于java - 你能让 JEditorPanes 理解高级 HTML 和 CSS 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23229483/