我正在尝试设置我的 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);
}
});
}