Setting Code Formatting Preferences

1.

From the workbench menu bar, select Window > Preferences > Java > Code Formatter.

2.

In the Newline, Style, and Line splitting areas, select the code formatting conventions that you want the formatter to follow.

3.

In the bottom part of the page, you can observe an example effect of each individual code formatting option and see a preview of what your formatted code would look like.

4.

Click either Apply or OK when you are done.