Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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

I know this subject is quite old now but it may be useful.

You can force the look and feel with the following environment variable:

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top