thegoodone thegoodone -4 years ago 73
Java Question

JTextArea - How to add Code/Syntax highlighting?

Im developing an app in java, a simple text editor. What I want to do is to add syntax highlighting, so it will color java (pubic, static, void, int, float). How can I do that? Thanks.

Answer Source

You can take a look at this old discussion, but it sounds tricky. Check this out. But I don't know if JTextArea is what you're looking for, read some docs for JTextPane or JEditorPane. You may want to use them.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download