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.
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.
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...