Did you enable auto formatting "on save"? Under Preferences, choose Java --> Editor --> Save Actions. Check the "Perform the selected actions on save", and check the "Format source code" box.