O'Reilly logo

NetBeans IDE 8 Cookbook by Rhawi Dantas, David Salter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Formatting the code

Once we've written and run/debugged some of our code, it's generally a good idea to check that the code follows some layout guidelines.

In this recipe, we'll see how we can quickly and easily format the code so that all of our code has a standard layout making it easier for us and others to read.

Getting ready

It is necessary to have a project in order to format the code within it. If you are unsure on how to create a project, please check the recipes in Chapter 1, Using NetBeans Projects. To help follow this recipe, when creating a project, enter FormattingCode as the project name and ensure that the option to create a main class called com.davidsalter.cookbook.formattingcode.FormattingCode is selected.

How to do it…

  1. Expand the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required