设置组件外观

发布于 2024-09-27 15:42:03 字数 119 浏览 0 评论 0原文

我使用物质外观和感觉作为我的应用程序默认外观和感觉,但是我想设置 FileDialog 的系统外观和感觉,尤其是在 Mac OS 中。是否可以将 FileDialog 设置为使用应用程序外观以外的外观?

谢谢

I'm using substance look and feel as my application default look and feel, however I want to set the system look and feel for FileDialog especially in Mac OS. Is it possible to set FileDialog to use look and feel other than the application look and feel?

Thanks

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

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

发布评论

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

评论(2

情丝乱 2024-10-04 15:42:03

java.awt.FileDialog is not a Swing component, so it doesn't have a UI delegate to change. Although some prefer the former on Mac OS X, consider javax.swing.JFileChooser as an alternative.

染年凉城似染瑾 2024-10-04 15:42:03

组件的LAF是在创建组件时确定的。所以你可以尝试使用:

a) 设置 LAF
b) 组件的创建和实例
c) 将 LAF 恢复为默认 LAF

有些人建议不要采用这种方法,建议所有组件都应属于同一 LAF,并且当您尝试混合 LAF 时可能会出现一些意外问题。我会让你来判断这是否适合你。

The LAF of a component is determined when a component is created. So you can try using:

a) set the LAF
b) create and instance of the component
c) restore the LAF to your default LAF

Some people have recommended against this approach suggesting that all components should be of the same LAF and there may be some unexpected problems when you try to mix LAF's. I'll let you be the judge if this will work for you or not.

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