Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

swing text editor that color and highlight

i am writing an application that the user need to writes a javascript script as an input, right now i have a simple JTextArea but i would like to change it with something that will do some highlights and code coloring to make the script more coherent.

do you know any open source thing that does that?

thanks

like image 742
special0ne Avatar asked Jan 07 '10 14:01

special0ne


3 Answers

RSyntaxTextArea

RSyntaxTextArea is a syntax highlighting text component for Java Swing. It extends JTextComponent so it integrates completely with the standard javax.swing.text package. It is fast and efficient, and can be used in any application that needs to edit or view source code.

RSyntaxTextArea was originally part of the RText programmer's text editor, but is currently being made into a separate component, reusable in any Swing application.

Screenshot:

enter image description here

like image 53
逸飞. Avatar answered Sep 19 '22 20:09

逸飞.


Try jEdit. It is mainly an editor written in Java and not an editor component. But perhaps you can extract the editor component from the jar file.

Just an idea.

like image 45
nalply Avatar answered Sep 18 '22 20:09

nalply


Take a look at what the NetBeans Platform provides. I know that they do release components as JARfiles, but they're not available in the Maven central repo, which has kept me from using any.

like image 29
kdgregory Avatar answered Sep 21 '22 20:09

kdgregory