Java eclipse WindowBuilder, change look and feel

后端 未结 5 1415
难免孤独
难免孤独 2020-12-10 15:17

im coding a program using windowbuilder in eclipse. I would like to have help with changing the design (Look and feel) from metal to windows. How would i do that? thank you<

5条回答
  •  眼角桃花
    2020-12-10 15:33

     try {
                for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Windows".equals(info.getName())) {
                        javax.swing.UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (ClassNotFoundException ex) {
                java.util.logging.Logger.getLogger(BiatApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(BiatApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(BiatApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(BiatApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
    

提交回复
热议问题