java - 你能让 JEditorPanes 理解高级 HTML 和 CSS 吗?

标签 java swing jeditorpane

是否可以制作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/

相关文章:

java - HQL 变量 过滤案例

java - 当调用 setCharacterAttributes 时,JEditorPane HTMLDocument 将 p-implied 添加到 HTML 中,这是不必要的

java - "error: int cannot be dereferenced"尝试从 array.length 中减 1

java - 将依赖项添加到 Scala 项目 (sbt)

java - "=="在 Java 中的字符串连接的情况下

java - Java中如何将一个JList中的元素转移到另一个JList中?

java - 启动和关闭指向 Web 应用程序的 native 浏览器

java - 如何在 SwingWorker 线程中取消 did() ?

java - JTextPane 中未显示元素符号

java - 控制带有长文本的 JEditorPane 的首选大小