How can I package the swing-layout-version.jar library into my application JAR?

Having developed your Swing application in Matisse (using the "Free Design" layout) you can package the required swing-layout-version.jar library inside your application JAR file.


Open your project's build.xml from the Files tab and insert this:

    <target name="-post-jar">
        <jar update="true" destfile="${dist.jar}">
            <zipfileset src="${libs.swing-layout.classpath}"/>

Just press F11 to build your project as usual. This Ant target will bundle swing-layout.jar inside your distribution JAR file.

You can adapt this Ant target to different requirements.

Note: The default and preferred way is to distribute the swing-layout-version.jar separately, as described in the How to run and distribute...

  Applies to: NetBeans 5.0, 5.5, 6.x
  Platforms: All
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo