在swing开发中获取系统已安装的lookAndfeel类的方法

阅读更多
public Voctor getLookAndfeel(){
Vector  supportedLaFs;
UIManager.LookAndFeelInfo[] installedLafs = UIManager
				.getInstalledLookAndFeels();

for (UIManager.LookAndFeelInfo lafInfo : installedLafs) {
	
try {
	
Class lnfClass = Class.forName(lafInfo.getClassName());
	
LookAndFeel laf = (LookAndFeel) (lnfClass.newInstance());

if (laf.isSupportedLookAndFeel()) {

String name = lafInfo.getName();

System.out.println(lafInfo.getClassName());
				
supportedLaFs.add(laf);

}

} catch (Exception e) { 
// If ANYTHING weird happens, don't add it

continue;

}
}

return supportedLaFs;
}

 

你可能感兴趣的:(在swing开发中获取系统已安装的lookAndfeel类的方法)