Select the source folder, for example "java", and use the command Ctrl + Alt + L
OR
Right-click on the source folder, say, for example, "java" and select "Reformat Code". The "Reformat Code" dialog box appears. Check the box next to "Include subdirectories" and click "Run."

source share