如何为 JNLP 应用程序设置 Java 系统外观?

发布于 2024-08-22 02:21:00 字数 578 浏览 1 评论 0 原文

我在 OpenSuse 上运行 Gnome。结果,我的系统外观和感觉是 GTK+,它有许多丑陋的问题(请参阅其中一些 此处)。

在开发 swing 应用程序期间,我可以从命令行或 IDE 运行客户端并指定 VM 参数

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

使其看起来不错。

但我不知道当我通过 JNLP 启动应用程序时如何强制 Java Webstart 使用此 VM 参数。

编辑: 这与设置外观和外观的编程能力无关。感觉。应用程序可以正确执行此操作。

我的问题是如何告诉 Java Webstart 在运行 myapp.jnlp 文件时使用 VM 参数“swing.systemlaf”。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

硬不硬你别怂 2024-08-29 02:21:00

Java Web Start 允许使用 j2se 元素的 java-vm-args 属性设置某些 JVM 标志
但您可以使用

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

和设置属性。它将通过 System.getProperty 和 System.setProperties 方法获得

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

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

熟人话多 2024-08-29 02:21:00

您始终可以使用 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

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

独闯女儿国 2024-08-29 02:21:00

我知道这个主题现在已经很老了,但它可能很有用。

您可以使用以下环境变量强制外观:

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

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"
痴情 2024-08-29 02:21:00

我相信您可以使用 -userConfig 命令行选项在 WebStart 中配置属性。 WebStart dialgos 是 JRE 安装的一部分,而不是应用程序的一部分。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文