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

Building a distributable application from NetBeans


When we've developed our application, we want to get it out of the IDE and into our customer's hands as soon as possible. Fortunately, NetBeans makes it very easy to create an executable .jar file that we can distribute to our customers.

Getting started

To complete this recipe, we need to have the JarViewer project that was created in the Responding to events recipe. If you have not completed this recipe, the source code is available with the code download bundle for this chapter.

How to do it…

When NetBeans builds an executable .jar file for a desktop GUI application, it adds all the necessary references to any external libraries that are required and bundles those with the application. Since our JarViewer application doesn't use any third-party dependencies, let's add one on the assumption that our application does use it. We'll add the Java DB driver to our project, as it's possible to see that at some point in the future we may want to add...