About Editing Java Source Files
The IDE's built-in Source Editor enables you to
view, create, and edit your Java source code.
You can open the Source Editor
window by double-clicking an editable element in the Projects window or by choosing
File > New to create a new file.
The IDE has many features to simplify coding of Java files such as:
- Code completion.
After you press Ctrl-Space, a dialog box appears and offers possible ways of completing the expression
you are typing.
- Code templates.
You can enter common code snippets by typing abbreviations for those snippets
and then pressing Tab.
- Editor hints. For some common coding mistakes,
the Source Editor provides hints for adding the missing code and offers to add the
code for you automatically. To display hints, choose Source > Fix Code (Alt-Enter).
- Insert Code. You can generate getters, setters, properties, and so on. Right-click in the
Source Editor and choose Insert Code (Alt-Insert) to get a list of items that you can generate.
- BeanInfo Editor. You can generate a BeanInfo class for a bean class by right-clicking
the bean class in the Project window and choosing BeanInfo Editor. You can then
visually edit the BeanInfo class by clicking the Designer tab in the Source Editor.
- Word match. After you type the beginning
characters of a word used elsewhere in your code and then press Ctrl-K, the Source Editor generates
the rest of the word.
- GUI Builder. Visually
design Java GUI applications.
- Refactoring. Change
the structure of your code without changing the functionality.
- Navigation Shortcuts. Include keyboard shortcuts that
enable you to navigate to a source file, declaration statement, or Javadoc
documentation based on the location of the insertion point.
- Code Folding. Enables you to hide
sections of code, such as Javadoc comments and method bodies.
- Pair Completion, Smart Enter, and
Smart Semicolons. When you type a quotation mark, bracket, brace,
or parenthesis, the Source Editor automatically inserts the closing character.
The matching is "smart", so the closing characters are not duplicated if you
type them yourself.
- Macros. Record macros by choosing Edit > Start Recording Macro.
- Import Management. The Ctrl-Shift-I keyboard
shortcut helps you generate missing import statements for the file.
- You can find information about other Source Editor features in help topics that
are specific to the type of application you are developing.
- See Also
- Modifying GUI Source Code
Legal Notices