Where can I find a syntax highlighting library for Java? [closed]
Solution 1:
Something like JSyntaxPane
, perhaps?
A very simple to use and extend JEditorKit that supports few languages. The main goal is to make it easy to have nice looking Java Swing Editors with support for Syntax Highlighting.
Solution 2:
What about RSyntaxTextArea? It uses a modified BSD license.
Solution 3:
You first should think about using a common parser to create an AST (abstract syntax tree) from the sources. There are some tools around, first I find googling the internet was javaparser. It looks like this parser also records line numbers and columns, so the AST from javaparser can be a nice model for the editor.
Just process the tree, define colors for the AST node types and print it.