Search code examples
javaswingjframelook-and-feel

How can i set defaultlookandfeel to window for Jframe


I made a simple Jframe with its child components in netbeans, when i run the application it shows it in NIMBUZZ lookandfeel as shown below:-

This is what i have

But I want it to be always shown in WINDOWS lookandfeel as shown below :-

This is what i want

How am I suppose to do that??


Solution

  • Before creating your first window call this code:

    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    

    note that this will work as expected only under windows where this is the system LAF