0

I have a jar that is loaded into a large Java platform.

There appears to be a custom LookAndFeel, which any Panels etc I create picks up.

Now I need to create a new jFrame, however, it doess NOT inherit the current lookandfeel.

How may I specify that it does this?

I tried this but it change all look and feels to something not too stable (visual glitches etc)

try {
            // Set cross-platform Java L&F (also called "Metal")
        UIManager.setLookAndFeel(
            UIManager.getCrossPlatformLookAndFeelClassName());
    } 
    catch (UnsupportedLookAndFeelException e) {
       // handle exception
    }
    catch (ClassNotFoundException e) {
       // handle exception
    }
    catch (InstantiationException e) {
       // handle exception
    }
    catch (IllegalAccessException e) {
       // handle exception
    }

and when I look here:

UIManager.LookAndFeelInfo[] x = UIManager.getInstalledLookAndFeels();

it does NOT appear to have a custon LookAndFell in the list.

The main question is WHY does new jFrame NOT inherit the existing L&F?

ManInMoon
  • 6,795
  • 15
  • 70
  • 133
  • I think some more code samples and screenshots would be helpful. What code is called in what order to produce what result? – Charlie Apr 03 '14 at 21:43
  • The custom "look and feel" must be implemented somewhere in that jar file--that's what you need to load, not the cross platform look-and-feel or the installed look-and-feel (although I like the way the installed look-and-feel looks--but it won't match a custom one). – Jared Apr 03 '14 at 21:55
  • I have found the custom one - but when I apply it - nothing happens - its still th default that is used when new frame is displayed – ManInMoon Apr 03 '14 at 22:36

0 Answers0