简体   繁体   English

有没有办法让Nimbus Look&Feel为顶级JFrame渲染自己的Windows装饰?

[英]Is there a way to have the Nimbus Look&Feel render its own windows decorations for a top level JFrame?

Is there a way to have the Nimbus Look&Feel render its own windows decorations for a top level JFrame ? 有没有办法让Nimbus Look&Feel为顶级JFrame渲染自己的Windows装饰? I've been digging through the Internet, and I'm starting to suspect it might not be possible at all. 我一直在通过Internet进行挖掘,并且开始怀疑它根本不可能实现。 Has anyone actually succeeded with (and cared about) that? 有人真的成功(并关心过)吗?

Nimbus decorations are nice and neat for internal frames , but apparently there is no way to have the same effect on JFrame s and JDialog s. Nimbus装饰对于内部框架 来说很好,也很整洁,但是显然没有办法对JFrameJDialog产生相同的效果。

I tried nimbusx (Nimbus Extensions), a library that subclasses JFrame and JDialog and allegedly applies nimbus-styled decorations to them (then you just have to instantiate nimbusx classes instead of JFrame and JDialog ); 我尝试了nimbusx (Nimbus扩展),该库将JFrameJDialog子类化,并据称对其应用了nimbus风格的装饰(然后您只需实例化nimbusx类,而不是JFrameJDialog ); but it actually doesn't work, and it's been in an inactive alpha stage since 2009. 但实际上它是行不通的,并且自2009年以来一直处于无效Alpha阶段。

So, did anyone succeeded in having their nimbus-styled Java application look consistent on all platforms by having the Nimbus LAF take care of window decorations? 那么,是否有人通过Nimbus LAF来照顾窗户装饰,从而成功地使他们的Nimbus样式的Java应用程序在所有平台上看起来都一致?

I've done this with JGoodies Looks in the past. 过去,我是通过JGoodies Looks完成的。 I don't know if Nimbus supports it or not. 我不知道Nimbus是否支持。

It's not only the LAF, however, it is an option you must programmatically turn on for JFrame (and JDialog if you want). 它不仅是LAF,而且是您必须以编程方式为JFrame(和JDialog,如果需要)打开的选项。

JFrame.setDefaultLookAndFeelDecorated( true );
JDialog.setDefaultLookAndFeelDecorated( true );

See the API Docs 请参阅API文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM