设置组件外观
我使用物质外观和感觉作为我的应用程序默认外观和感觉,但是我想设置 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
java.awt.FileDialog
< /a> 不是 Swing 组件,因此它没有要更改的 UI 委托。尽管有些人在 Mac OS X 上更喜欢前者,但请考虑javax.swing.JFileChooser
作为替代方案。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, considerjavax.swing.JFileChooser
as an alternative.组件的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.