java - 获取此错误 java.lang.ClassNotFoundException: sun.swing.plaf.nimbus.NimbusLookAndFeel
问题描述
我的代码出错这是我的代码:
public static void main(String args[]) {
try {
for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Windows".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(mainframe.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(mainframe.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(mainframe.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(mainframe.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
TimeUnit.SECONDS.toSeconds(10);
} catch (Exception e) {
}
new mainframe().setVisible(true);
}
});
}
解决方案
推荐阅读
- elasticsearch - Logstash 索引未反映在 Kibana 中
- uwp - 安装 UWP 应用返回未经授权的错误
- google-apps-script - google apps 脚本创建的 html 发布在 Google Docs 中,从今天开始出现错误
- jmeter - 通过java代码添加jmeter用户参数预处理器
- scala - Spark SQL:如果存在则更新,否则忽略
- javascript - 使用来自 servlet 的上一个表单值重定向回上一个 jsp 页面
- image - TclError:图像“pyimage68”不存在
- javascript - 两个点击事件同时工作
- html - 如何访问 html 文件中 manifest.json 中映射的文件?
- spring-boot - SpringBoot 使用 ControllerAdvice 中的自定义错误处理所有错误