fredag 19 november 2010

Nimbus with JNLP

We want to use the Nimbus look and feel in our project and use the following code in our Installer.restored method (as described at http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/nimbus.html):

try {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
            UIManager.setLookAndFeel(info.getClassName());
            break;
        }
    }
} catch (Exception e) {
    // If Nimbus is not available, you can set the GUI to another look and feel.
}

And this works nicelly! However, due to 
https://netbeans.org/bugzilla/show_bug.cgi?id=190175 this 
does not really work with jnlp yet... I'll be back!
 
*** 2010-12-09 ***
By adding  the following to you master.jnlp Nimbus is run on webstart too 
(wouldnt mind having 190175 fixed anyway but still...):
  <application-desc>
    <argument>--laf</argument>
    <argument>com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel</argument>
  </application-desc>
 

Inga kommentarer:

Skicka en kommentar