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

Fixing and organizing imports

With anything more than a very basic application, a developer needs to import other packages into their classes for them to function correctly. This quickly leads to a number of import statements at the top of a class file. NetBeans offers facilities to automatically add import statements (fix imports), in order to save developer time, and the ability to tidy up the import statements (organize imports).

Getting ready

It is necessary to have a project with valid Java source code in order to fix and organize imports. 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 UsingImports as the project name and ...

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