How can I configure the Java system for JNLP applications?

I am running Gnome on OpenSuse. The result is my GTK + system look, which has a lot of ugly issues (see some of them here ).

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

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

so that he looks good.

But I do not know how to force Java Webstart to use this VM parameter when starting the application through JNLP.

change This has nothing to do with the software ability to set the look. The app does it right.

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

+3
source share
4 answers

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

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

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

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

+3
source

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

+2
source

, , .

:

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

I believe that you can configure properties in WebStart using the command line -userConfig. Dialgos WebStart are part of the JRE installation, not part of the application.

0
source

Source: https://habr.com/ru/post/1732548/


All Articles