0

i'm working in java, i'm developing a programming language and i'm building the ide for it. the problem is that i'd like to have a textArea like netbeans ide's one, with formatted and colored text. for example i'd like to have a textarea where reserved words are blue, numbers are purple and function names are bold, how is it possible without losing efficiency while typing?

  • 2
    You probably want to use a [JTextPane](http://docs.oracle.com/javase/8/docs/api/javax/swing/JTextPane.html) rather than a JTextArea. As for efficiency, you may have noticed that existing IDEs have pretty heavy CPU usage; I doubt that can be avoided. – VGR May 25 '16 at 19:06

1 Answers1

1

Certain libraries allow you to create special text areas for this exact purpose. The most popular textArea is the RSyntaxTextArea

Two other related questions which may help:

What code highlighting libs are there for Java?

Where can I find a syntax highlighting library for Java?

Community
  • 1
  • 1
Jorel Ali
  • 383
  • 1
  • 3
  • 9