Formatting files or portions of code

To format Java code:
  1. Use the Code Formatting Preferences page (Window > Preferences > Java > Code Formatter) to specify your preferences for code formatting.

  2. Open a Java file and select the code you want to format. If nothing is selected, then all of the editor content is formatted.

  3. Format the code by either

Related concepts

Java development tools (JDT)
Java editor

Related tasks

Using the Java editor
Formatting Java code
Setting code formatting preferences

Related reference

Source menu
Code Formatter preferences

Copyright IBM Corporation 2000, 2002. All Rights Reserved.