2

This method

UIManager.setLookAndFeel(new SubstanceCeruleanLookAndFeel());

sets the L&F for the whole app. How do I combine this and then set different L&F just for JFrame?

EDIT

I've found this article on Multiplexing Look and Feels. How exactly does this work? I can't find any examples.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
bunnyjesse112
  • 747
  • 6
  • 27
  • 44
  • 1
    why? Anyway, simply don't - Swing is designed to support a single LAF per application. Typically, mixing will result in unpredictable visuals and behaviour. As @trashgod already noted, JFrame is _not_ a JComponent, that is, it has no ui delegate to set .. the only thingy that might be taken over by the LAF is the frame decoration, see JFrame.setDefaultLookAndFeelDecoration – kleopatra Jan 06 '12 at 10:42
  • So, can i use one laf for the whole app, and decorate frames using another laf? Or vice versa; use one laf, but then tell all components except frame decoration use another laf? Is this possible? I dont have skills to create my own laf so i wondered is there a way to combine lafs to make stuff look nice. – bunnyjesse112 Jan 06 '12 at 14:48

2 Answers2

4

You can override UI defaults for a JComponent easily enough; there's an example here that illustrates changing JTree icons. Unfortunately, JFrame is not a JComponent; it has no UI delegate, and its decorations are supplied by the host operating system.

For more specific guidance, you'll need to clarify what you're trying to accomplish.

See also Validation overlays using multiplex look and feel.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • thanks for response. But frames with substance laf has customized look i mean iconify and close buttons, some lafs has their windows with rounded corners. Can i somehow fetch this from one laf, and add to another? – bunnyjesse112 Jan 06 '12 at 08:31
  • 2
    @bunnyjesse112 no - it's either the LAF decoration or OS provided. What exactly do you want to achieve? – kleopatra Jan 06 '12 at 10:44
0

It is not possible, the look and feel is application wide.

fluca1978
  • 3,968
  • 2
  • 15
  • 15