Class SelectionHighlighter

java.lang.Object
org.xhtmlrenderer.swing.SelectionHighlighter
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener

@ParametersAreNonnullByDefault public class SelectionHighlighter extends Object implements MouseMotionListener, MouseListener

A simple Selection and Highlighter class for XHTMLPanel.

The current selection is available as a DOM Range via getSelectionRange. There is also a Swing action to copy the selection contents to the clipboard: SelectionHighlighter.CopyAction, which should be installed on the SelectionHighlighter

Usage: create the XHTMLPanel, create an instance of this class then call install. See also: /demos/samples/src/SelectionHighlighterTest.java

With thanks to Swing's DefaultCaret