怎么改变用swing控件做的软件的风格?

解决方案 »

  1.   

    1.可以在main方法中写设置软件风格的语句:
     public static void main(Stirng[] args){
       JFrame.setDefaultLookAndFeelDecorated(true);
       Font font=new Font("JFrame",Font.PLAIN,14);
       Enumeration keys=UIManager.getLookAndFeelDefaults().keys();
       while(keys.hasMoreElements()){
          Object key=keys.nextElement();
          if(UIManager.get(key)instanceof Font) UIManager.put(key.font);
       }
    }
    2.构造方法下写设置软件风格的语句也行:
     //三种界面风格
     String windows="com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
     //String metal="javax.swing.plaf.metal.MetalLookAndFeel";
     //String motif="com.sun.java.swing.plaf.motif.MotifLookAndFeel";
    try{
       UIManager.setLookAndFeel(windows);
       SwingUtilities.updateComponentTreeUI(this);
       this.pack();
    }catch(Exception e){
      System.out.println("不能设置这个界面风格:"+e);
    }
      

  2.   

    lookandfeel我这里有swing皮肤..=下去我空间找吧
      

  3.   

    UIManager.setLookAndFeel(LookAndFeel newLookAndFeel);
    UIManager.setLookAndFeel(String className);
    两个都行
      

  4.   

    那我下了你的皮肤
    该怎么用UIManager.setLookAndFeel(windows); 
    这句话好像用类做参数
      

  5.   

    UIManager.setLookAndFeel(LookAndFeel newLookAndFeel);
    windows mac java各种风格都有.
      

  6.   

    try {
    UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName());
    }
    catch (Exception e) {
    System.out.println ("无法设置界面风格");
    }//设置为当前系统默认界面样式(入乡随俗)
      

  7.   

    看看这个
    https://substance.dev.java.net/
      

  8.   

    https://substance.dev.java.net/这个好漂亮
      

  9.   

    自己做撒,你也是用java的吗!其实所谓的皮肤,不过就是颜色和图片度组合封装到一个类吗!然后导入到你要用的界面类去就可以啦啊!