Chapter 3. Working with the Source Editor

Why Learn a New Editor?

Learning to use yet another source code editor was probably not high on your to-do list this year. However, the NetBeans syntax-coloring Source Editor, which is tightly integrated with the rest of the IDE, is easy to learn and is indispensible to your NetBeans development work flow.

The reason it is easy to learn the NetBeans Source Editor is that its behavior is unsurprising to anyone who has ever used a modern GUI text editor, especially one coded in Java. Try to guess what key sequences are required to copy, cut, and paste highlighted text? If you guessed Control-C, Control-X, and Control-V, respectively, you were right. Control-S saves your changes, if any exist. Shift-Right Arrow selects text to the right, Shift-Control-Right Arrow selects text to the right a word at a time. Et surprises here.

The reason that the NetBeans Source Editor is indispensible to your NetBeans development work flow is the level of integration provided between objects in the NetBeans Explorer and Form Editor, code entities in your program, your actions within the editor, and the appearance of your code in the editor window.

Opening the Source Editor

There are two prinicipal ways to open a file in the NetBeans Source Editor:

  1. From the NetBeans Main Window, pull down File Open and use the file dialog to browse to the file you want to open.

  2. From within the NetBeans Explorer, find the node representing your source, right-click ...

Get NetBeans: The Definitive Guide 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.