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

前端 未结 3 910
醉话见心
醉话见心 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条回答
  •  萌比男神i
    2021-02-08 01:11

    See Changing the Look and Feel After Startup section of the java tutorial. You have to call like:

    UIManager.setLookAndFeel(lnfName);    
    SwingUtilities.updateComponentTreeUI(frame);    
    frame.pack();
    

    Where lnfName is the LookAndFeel name and frame is your JFrame Object.

提交回复
热议问题