JXEditorPane offers enhanced functionality over the standard
JEditorPane. Unlike its parent,
JEditorPane#HONOR_DISPLAY_PROPERTIES by default.
Users can revert to the behavior of
JEditorPane by setting the
Improved text editing
The standard text component commands for cut
used enhanced selection methods. The commands will only be
active if there is text to cut or copy selected or valid text in the
clipboard to paste.
Improved HTML editing
Using the context-sensitive approach for the standard text commands,
JXEditorPane provides HTML editing commands that alter functionality
depending on the document state. Currently, the user can quick-format the
document with headers (H# tags), paragraphs, and breaks.
Text components provide
JXEditorPaneplaces those events in an
UndoManager and provides
commands. Undo and redo are context-sensitive (like
the text commands) and will only be active if it is possible to perform the
JXEditorPane provides search capabilities, allowing the user to find text
within the document.
JXEditorPane is no different than creating a
JEditorPane. However, the following example demonstrates the best way to
access the improved command functionality.
JXEditorPane editorPane = new JXEditorPane("some URL");
JToolBar toolBar = ActionContainerFactory.createToolBar(editorPane.getCommands);