如何使 JFrame 具有与其他组件不同的外观(多路复用)?
此方法
UIManager.setLookAndFeel(new SubstanceCeruleanLookAndFeel());
设置整个应用程序的 L&F。如何组合它,然后为 JFrame
设置不同的 L&F?
编辑
我在多路复用外观。这到底是如何运作的?我找不到任何例子。
This method
UIManager.setLookAndFeel(new SubstanceCeruleanLookAndFeel());
sets the L&F for the whole app. How do I combine this and then set different L&F just for JFrame
?
EDIT
I've found this article on Multiplexing Look and Feels. How exactly does this work? I can't find any examples.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以轻松地覆盖
JComponent
的 UI 默认值; 此处有一个示例,说明了如何更改JTree
图标。不幸的是,JFrame
不是JComponent
;它没有 UI 委托,其装饰由主机操作系统提供。要获得更具体的指导,您需要澄清您想要实现的目标。
另请参阅使用多重外观和感觉进行验证叠加。
You can override UI defaults for a
JComponent
easily enough; there's an example here that illustrates changingJTree
icons. Unfortunately,JFrame
is not aJComponent
; it has no UI delegate, and its decorations are supplied by the host operating system.For more specific guidance, you'll need to clarify what you're trying to accomplish.
See also Validation overlays using multiplex look and feel.
这是不可能的,外观和感觉是广泛应用的。
It is not possible, the look and feel is application wide.