SWT designer中有一种liquid的风格蛮好的。代码里如何加入?
或者说这个参数是String,哪里可查这个参数。

解决方案 »

  1.   

    参数就是皮肤文件所在的路径,也就是主包名.子包名.类名的这种
    比如"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"
      

  2.   


    setLookAndFeel
    public static void setLookAndFeel(String className)
                               throws ClassNotFoundException,
                                      InstantiationException,
                                      IllegalAccessException,
                                      UnsupportedLookAndFeelExceptionSets the current default look and feel using a class name. 参数:
    className - a string specifying the name of the class that implements the look and feel 
    抛出: 
    ClassNotFoundException - if the LookAndFeel class could not be found 
    InstantiationException - if a new instance of the class couldn't be created 
    IllegalAccessException - if the class or initializer isn't accessible 
    UnsupportedLookAndFeelException - if lnf.isSupportedLookAndFeel() is false
      

  3.   


    你用解压缩软件(7zip,winrar等)打开位于jre/lib中的rt.jar包,然后com\sun\java\swing\plaf\这么一趟下来你会看见几个文件夹(会因JRE版本不同而不同,但至少会有windows,motif),这几个文件夹内就是各自的观感文件了,我给的例子是nimbus观感文件
    像你提到的观感文件,把它添加到环境中,如上引用即可...其实类似import不过SWT能使用观感?一直没用过SWT
      

  4.   

    楼上说的很对,个人感觉nimbus好看点儿,motif的效果太差了