问题
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 JFrame
s and JDialog
s.
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