Chapter ThirteenSyntax Highlighting

13.1. Introduction

One of the central features of an editor is its ability to distinguish between different elements of a language. For example, by default the IDE displays all Java keywords in blue, while method names are shown in black. This enhances the readability of Java code by giving each element a distinct and consistent appearance. The NetBeans API that lets you build and maintain a list of tokens is org.netbeans.api.lexer. A token is a related sequence of characters. For example, one token may be a sequence of characters that makes up a Java keyword; another, a sequence of characters making up a method name.

Where Are the Lexer Modules?

The Lexer modules, which provide the functionality discussed ...

Get Rich Client Programming: Plugging into the NetBeans Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.