By using a rich text editor, you can accelerate the speed of your writing (and content creation in general), in a web application since a WYSIWYG style editor shows you what your web page will look like.
WYSIWYG is a content editing tool. In WYSIWYG editors the edited content whether text or graphics, appears in a form close to a final product. So instead of manually writing source code, you deal with a convenient rich text editor in which you manipulate design elements.
Check out our list of free WYSIWYG Editors. Products featured on this list are the ones that offer a free trial version. As with most free versions, there are limitations, typically time or features.
RSyntaxTextArea
I've used this component and it works well. It is LGPL and it is based on javax.swing.text package (javax.swing.text.EditorKit). Since it is a Swing component it can be integrated in your application in a few lines of code :
RSyntaxTextArea textArea = new RSyntaxTextArea();
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
RTextScrollPane sp = new RTextScrollPane(textArea);
JWebEngine
I recommend JWebEngine. It is the only one that I know that passes the ACID1 browser test and the mail-acid test. Most other Java HTML editors are based on the javax.swing.text.html.HTMLDocument and have all the same bugs. The support of CSS is very poor with HTMLDocument. JWebEngine has very good support for viewing HTML with CSS.
Can be embedded in Java using the OOoBean. The original code runs under Swing but you can make it work under SWT, too, using the AWT/SWT Bridge (example code).
The project is open source (LGPL). The code is OS dependent but there are versions available for all major OSs (Windows, Linux, MacOS and Solaris are supported on the project's site but you can download the source and compile it for others, as well).
Since the underlying product is a full blown office application, it offers all the features you might want (fancy styles, online spell checking in different languages, embedding pictures, flow text around pictures, you name it).
The drawback is that you must have OpenOffice installed; in fact, the editor is not part of Java but it's a remote process which just renders in your Java app's window. This means that start up time is quite noticeable and performance can be sluggish. Also handling is sometimes "odd". It takes some configuration to get rid of additional borders and unwanted document pagination.
Because of this, the editor is not really extendable from Java. You will either have to write code in C++ or using OOo's own built-in language. What you can do is you can register listeners in the document and you have full access to the underlying model for the document. This way, you can hook into the important parts and modify the behavior but this often feels like performing keyhole surgery.
My conclusion: If OO has the features you need, this might be the most simple way to get what you need. If you need a lot of customization, you'll fight an upstream battle against the framework's defaults.
I needed the same thing for our application, did a research and found two more products EKit and Metaphase Editor, based on Charles Bell's HTMLDocumentEditor
, both under LGPL license and looking good.
But I did not test them. These days we shall see what we choose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With