问题描述
是否可以使Nimbus Look&Feel呈现其自己的Windows装饰,以用于顶级JFrame
?我一直在通过Internet进行挖掘,并且开始怀疑它根本不可能实现.真的有人成功(并关心)吗?
Is there a way to have the Nimbus Look&Feel render its own windows decorations for a top level JFrame
? I've been digging through the Internet, and I'm starting to suspect it might not be possible at all. Has anyone actually succeeded with (and cared about) that?
雨云装饰对于内部框架来说很好,而且很整洁,但是显然无法对JFrame
和JDialog
产生相同的效果.
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.
我尝试了 nimbusx (Nimbus扩展程序),该库是子类的JFrame
和JDialog
并据称对其应用了nimbus样式的装饰(然后,您只需实例化nimbusx类,而不是JFrame
和JDialog
);但是它实际上不起作用,自2009年以来一直处于非活动的Alpha阶段.
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
); but it actually doesn't work, and it's been in an inactive alpha stage since 2009.
那么,有没有人通过让Nimbus LAF来照顾窗户装饰而成功地使他们的nimbus样式的Java应用程序在所有平台上看起来都一致?
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?
推荐答案
我已经使用 JGoodies Looks .我不知道Nimbus是否支持.
I've done this with JGoodies Looks in the past. I don't know if Nimbus supports it or not.
这不仅是LAF,而且它是您必须以编程方式为JFrame(如果需要,也可以为JDialog)打开的选项.
It's not only the LAF, however, it is an option you must programmatically turn on for JFrame (and JDialog if you want).
JFrame.setDefaultLookAndFeelDecorated( true );
JDialog.setDefaultLookAndFeelDecorated( true );
请参见 API文档
这篇关于有没有办法让Nimbus外观为顶级JFrame渲染自己的Windows装饰?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!