swing下 改变窗口样式为windows风格(swing控件样式不美观解决方案)

在windows环境下可以用下面两种方法使窗口显示windows风格窗口!

            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");


public static void main(String[] args) {
         try
         {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");


           }catch(Exception e)
           {}
           new MyFrame();
}

posted @ 2011-03-02 15:53  ljlxyf  阅读(1828)  评论(1编辑  收藏  举报