项目场景:
mac jdk1.8 javaswing
问题描述:
空指针 at com.apple.laf.AquaMenuPainter.paintSelectedMenuItemBackground(AquaMenuPainter.java:153)
解决方案:
代码语言:javascript复制public addressBook() throws Exception {
con = Dbu.getCon(); //得到一个JDBC的链接
initialize();
String className = "javax.swing.plaf.metal.MetalLookAndFeel"; //更换观感
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
SwingUtilities.updateComponentTreeUI(this);
} catch(Exception e){
e.printStackTrace();
}
}
参考文章https://www.titanwolf.org/Network/q/6a3857a9-c9b1-4c66-acb2-e32e0e7983a8/y