Deploying Java GUI Applications
See Also
In order for the applications that you create to work
outside of the IDE, you might have to include some extra JAR files
when you deploy the application.
The following JAR files might be needed by your deployed applications:
- swing-layout-1.0.3.jar. This library contains the various layout-related
extensions, such as the GroupLayout layout manager. This library is included in
version 6 of the Java Platform, so you do not need to package it with your application
if you are deploying it to environments that have version 6 of the JRE.
- appframework-1.0.3.jar and swing-worker-1.1.jar.
These libraries represent the Swing Application Framework.
They are needed if you use the
Java Desktop Application template in creating your application. As of
JDK 6, the Swing Application Framework is not part of the Java Platform.
application is created with the Database shell of the Java Desktop Application
template or you have used the Bind dialog box in creating your application,
your application needs this library. As of
JDK 6, the Beans Binding library is not part of the Java Platform.
- You can find these JAR files in the
following folders on your system:
NetBeans_installation_folder/java/modules/ext/ (for the Beans Binding and Swing Application Framework libraries)
NetBeans_installation_folder/platform/modules/ext/ (for the Swing Layout Extensions library)
Preparing a GUI Application for Distribution
To ensure that your GUI application can reference these libraries at
runtime, the IDE automatically copies the library JAR files (and any other JAR
files on the project's classpath) to the dist/lib folder
whenever you build the project. The IDE also adds each of the JAR files
to the Class-Path element in the application JAR's manifest.mf
file.
- If your application does not make use of the support of one of
these libraries, that library is not included in the dist/lib
folder.
To prepare your GUI application for distribution outside of the IDE:
- Zip the project's dist folder (including the lib folder)
into a ZIP archive.
Running a Standalone GUI Application
Once you have distributed an archive of your GUI application,
your application can be run outside of the IDE from the command line.
To run a standalone GUI application from the command line:
- Navigate to the project's dist folder.
- Type the following:
java -jar jar_name.jar
- See Also
- Preparing a JAR for Deployment Outside the IDE
- Designing Java GUIs with the GUI Builder
- GUI Builder Tasks: Quick Reference
Legal Notices