Book Image

NetBeans IDE 8 Cookbook

By : David Salter, Rhawi Dantas
Book Image

NetBeans IDE 8 Cookbook

By: David Salter, Rhawi Dantas

Overview of this book

<p>From the start to the end of a Java project's lifecycle, this book will show you how to perform many key tasks with the NetBeans IDE, uncovering more about mobile, desktop, and enterprise Java along the way.</p> <p>You will start by creating Java projects and learning how to refactor and use NetBeans tools to increase developer efficiency. You will then get a walkthrough of how to create a desktop application before covering JavaFX and mobile applications and how to use external services within them. Having seen how to create many different types of applications, you will then be shown how to test and profile them before storing them in revision control systems such as Git or Subversion. Finally, you will learn how to extend NetBeans itself by adding new features to the IDE.</p>
Table of Contents (19 chapters)
NetBeans IDE 8 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Move refactoring


In the previous recipe, we saw how it's possible to rename various artifacts of a Java project. Sometimes, however, we've named our objects correctly, but we've put them in the wrong place! NetBeans allows developers to perform a Move refactor where class members can be moved to different classes or classes can be moved to different projects and/or packages.

Getting ready

First we will need a Java project to perform some Move refactoring. We will use the same project from the preceding recipe, Rename refactoring, and so ensure that you have the project open from the end of that recipe. If you have not followed that recipe, the project is available from the code download bundle under the MoveRefactor folder in Chapter 3. When the Projects explorer shows the Refactoring project, expand the Refactoring node if not yet expanded.

How to do it…

  1. Open the EnvironmentPrinter.java file for editing from the Projects explorer by double-clicking on the filename.

  2. When we look at this file...