Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Say, I have 3 panels added to a frame and for the 1st panel i want to set the metal look and feel, for the 2nd panel I want windows look and feel, for the third panel it should be default swing style.

is it possible?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

The javax.swing.UIManager class, where the look and feel is set, is a singleton. Only one can be set at any one time.

However, you can (if you're so inclined) override UI delegates on individual components (see JComponent.setUI()). Using this method you could probably hack together some components that use UI delegates of alternate look and feels. But in most cases they'll look up the UIDefaults set by the "real" look and feel, so at best it's probably going to be a poor approximation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...