Geertjan's Blog

  • November 3, 2010

Nimbus Look and Feel for Maven Based NetBeans RCP Applications

Geertjan Wielenga
Product Manager
Let's create a Maven based NetBeans Platform app that uses the Nimbus look and feel. Here's how you'd do so for an Ant based application.

Start by putting the highlighted elements below in the POM of the application module:



Then switch to the Files window and, in the application module, create the above folder structure, i.e., "src/main/resources". In the "resources" folder you created, copy the "netbeans.conf" file from the NetBeans IDE installation directory (specifically, find it in the "etc" folder) and then change the name of the file to "my.conf".

In the "default_options" key, which is in the "netbeans.conf" file that you copied, add this value:

--laf com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

In other words, your "default_options" key is now something like this:

default_options="--laf com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel -J-Xms48m -J-Xmx512m -J-XX:MaxPermSize=240m "

Then run "Clean" on the parent module. Now run the application module. Hurray, you now have Nimbus:

Plus, note that you don't only have Nimbus while you're developing: your custom conf file now replaces the default template that would otherwise have been copied into your final application. You can now, for example, specify the JDK that will be used, as well as the memory settings, in your custom conf file, in the knowledge that those settings will be the same as those that the end users will end up with when you distribute the application to them.

Join the discussion

Comments ( 2 )
  • Jesse Glick Monday, November 8, 2010

    Setting a custom etcConfFile is probably not right. You would likely want this setting to apply to every run mode, including JNLP. Current nbm:cluster-app does not include additionalArguments in the generated conf file, but probably it should (with another token substitution); file an RFE in http://jira.codehaus.org/browse/MNBMODULE if you agree.

  • Justin Smith Friday, November 16, 2012

    Helpful post!

    Any idea how to ship a platform app (being built by the NBM plugin) with an included update-site? For instance, I can generate the update sute with the autoupdate goal, but currently, my clients have to add our update site to their installs manually, and I cannot for the life of me find anything in the docs (perhaps I have overlooked it!).

    Thanks, your posts have been extremely helpful in our adoption of platform apps.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.