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