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

£可爱£侵袭症+ 提交于 2019-12-19 04:20:15

问题


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?

Nimbus decorations are nice and neat for internal frames, but apparently there is no way to have the same effect on JFrames and JDialogs.

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.

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?


回答1:


I've done this with JGoodies Looks in the past. I don't know if Nimbus supports it or not.

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 );

See the API Docs



来源:https://stackoverflow.com/questions/9002282/is-there-a-way-to-have-the-nimbus-lookfeel-render-its-own-windows-decorations-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!