Java 所见即所得的 HTML 编辑器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1893429/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java WYSIWYG HTML editor
提问by Kyle
I'm working on a project and need a simple, free, Java HTML WYSIWYG editor. Can anyone point me in the right direction?.
我正在处理一个项目,需要一个简单、免费的 Java HTML WYSIWYG 编辑器。任何人都可以指出我正确的方向吗?
It only has a small space to fit into, so something fairly simple would be best.
它只能容纳一个很小的空间,所以最好是一些相当简单的东西。
采纳答案by VonC
回答by Dmytrii Nagirniak
If it the editor should run in a browser then there is nothing to do with Java and you can use any of these:
如果编辑器应该在浏览器中运行,那么与 Java 无关,您可以使用以下任何一种:
but if you need to embed the HTML editor into a desktop app then you probably need to find the one you like and try which fits best.
但是如果您需要将 HTML 编辑器嵌入到桌面应用程序中,那么您可能需要找到您喜欢的那个并尝试最适合的那个。
回答by Horcrux7
If you need a good WYSIWYG HTML editor then I recommended JWebEngine. It is the only one that I know that pass the ACID1 browser test and the mail-acid test. The most other Java HTML editors based on the javax.swing.text.html.HTMLDocument and have all the same bugs. The support of CSS is very poor in the HTMLDocument. JWebEngine has a very good support for viewing HTML with CSS. But it is also compatible JEditorPane or JTextPane and you can use it together with third party tools like the spell checker JOrtho.
如果您需要一个好的 WYSIWYG HTML 编辑器,那么我推荐JWebEngine。它是我所知道的唯一一个通过 ACID1 浏览器测试和 mail-acid 测试的。大多数其他基于 javax.swing.text.html.HTMLDocument 的 Java HTML 编辑器都有相同的错误。HTMLDocument 中对CSS 的支持很差。JWebEngine 对用 CSS 查看 HTML 有很好的支持。但它也兼容 JEditorPane 或 JTextPane,您可以将它与拼写检查器 JOrtho 等第三方工具一起使用。
回答by rudolfv
Have a look at Metaphase Editor. It's a WYSWIWYG HTML Editor component for Java and is licensed under LGPL. The binaries and sources are available at Project Kenai.
看看Metaphase Editor。它是用于 Java 的 WYSWIWYG HTML 编辑器组件,并在 LGPL 下获得许可。二进制文件和源代码可从Project Kenai 获得。
回答by dajood
I was searching for the same stuff. Have a look at these two solutions:
我正在寻找相同的东西。看看这两个解决方案:
I've found another, very nice solution: Use a JFXPanel to incorporate the HTML WYSIWYG editor component that's included in the latest versions of JavaFX. This is the way i'll go.
我找到了另一个非常好的解决方案:使用 JFXPanel 来合并最新版本的 JavaFX 中包含的 HTML WYSIWYG 编辑器组件。这就是我要走的路。