Formatting Java Code in Eclipse

From SwinBrain

This article shows how to use the automated code formatter in Eclipse.

This is a How To article designed to give step-by-step instructions. Search SwinBrain and the external links if you require more detailed information about this topic.
The Eclipse Java code formatting dialog.

Eclipse IDE provides functionality to create you own custom code formatter (or) to import an existing code formatting profile.

To get to the formatting dialog in Eclipse 3.2/3.3: 'Window -> Preferences -> Java -> Code Style -> Formatter'

Once you get to the dialog, you can select to use the Sun Java Code formatting standard, the Eclipse standard (or) import the Swinburne Java code formatting profile.

Once you have imported the profile (or) selected/customized your own profile then "Ctrl-Shift-F" will format code in the editor.

[edit]Links: Topic Brains
Return to Swin Brain