【无标题】

2022-10-25 17:28:20 浏览数 (1)

项目场景:

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

0 人点赞