jEdit's text area component. It is more suited for editing program source code than JEditorPane, because it drops the unnecessary features (images, variable-width lines, and so on) and adds a whole bunch of useful goodies such as:
- More flexible key binding scheme
- Supports macro recorders
- Rectangular selection
- Bracket highlighting
- Syntax highlighting
- Command repetition
- Block caret can be enabled
It is also faster and doesn't have as many problems. It can be used in other applications; the only other part of jEdit it depends on is the syntax package.
To use it in your app, treat it like any other component, for example:
JEditTextArea ta = new JEditTextArea(); ta.setTokenMarker( new JavaTokenMarker() ); ta.setText( "public class Test {\n" + " public static void main(String[] args) {\n" + " System.out.println(\"Hello World\");\n" + " }\n" + "}" );
@author Slava Pestov
@version $Id$