views:

246

answers:

3

I am running Gnome on OpenSuse. As a result, my system look and feel is GTK+, which has numerous ugly problems (see some of them here).

During development of my swing app, I can run the client from command line or IDE and specify VM parameter

-Dswing.systemlaf=com.sun.javax.swing.plaf.metal.CrossPlatformLookAndFeel

to make it look good.

But I don't know how to force Java Webstart to use this VM parameter when I start the application through JNLP.

edit: This has nothing to do with the programmatic ability to set the look & feel. The application does this properly.

My question is how to tell Java Webstart to use a VM parameter "swing.systemlaf" when it runs the myapp.jnlp file.

+1  A: 

You can always use UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

Kristopher Ives
No, I need to tell Java Webstart to set the VM property when I fire up the myapp.jnlp file.
Tim Drisdelle
(`getCrossPlatformLookAndFeelClassName() `)
Tom Hawtin - tackline
Tim Drisdelle
A: 

I believe you can configure properties in WebStart using the -userConfig command line option. The WebStart dialgos are part of the JRE installation, and not part of the application.

Tom Hawtin - tackline
+3  A: 

Java Web Start allows certain JVM flags to be set with the java-vm-args attribute of the j2se element but you may use

<property name="key" value="overwritten"/>  

and set properties. it will be available through the System.getProperty and System.setProperties methods

http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html#resources

Joseph Kulandai