How can I change the default look and feel of Jframe? (Not theme of Netbeans)

前端 未结 3 835
醉话见心
醉话见心 2021-02-08 00:54

I want to change the default look and feel of all the jframe forms I\'ll create from here on out instead of having to manually edit every look and feel code of every jframe I cr

3条回答
  •  故里飘歌
    2021-02-08 01:18

    1. try {
    2.        for (javax.swing.UIManager.LookAndFeelInfo info :  javax.swing.UIManager.getInstalledLookAndFeels()) {
    3.            if ("*Windows*".equals(info.getName())) {
    4.               javax.swing.UIManager.setLookAndFeel(info.getClassName());
    5.                break;
    6.             }
    7.         }
    8.    }
    

    at line '3' just replace "windows" by "Nimbus" and put this code in main frame of application and call another frames in nested form it will automatically apply nimbus theam for all the forms.

提交回复
热议问题