我试图设置我的GUI的外观和感觉。我已经发现了UnsupportedLookAndFeelException,但是当我编译时,我得到一个错误,说UnsupportedLookAndFeelException必须被捕获或声明为抛出。错误在这条线上:Ne r = new Ne();已被捕获的异常,仍然给出错误
下面的代码:
public static void main(String[] args) {
try{
UIManager man = new UIManager();
man.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel") ;
}
catch(UnsupportedLookAndFeelException ex){}
catch(Exception ex){}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Ne r = new Ne();
r.setVisible(true);
}
});
}
是你制作的对象类型吗?如果是这样,构造函数是否有'@Throws UnsupportedLookAndFellException'语句?那班怎么样? – 2012-04-19 23:28:27