今天在windows10开发环境下,使用java swing外观很不美观,故想使用windows 10 外观进行开发。在网上找了一下,可以实现这一点。windows 10 、linux等更多的情况下都可以使用这段代码解决。
更改一下外观为本地开发系统的:
if(UIManager.getLookAndFeel().isSupportedLookAndFeel()){
final String platform = UIManager.getSystemLookAndFeelClassName();
// If the current Look & Feel does not match the platform Look & Feel,
// change it so it does.
if (!UIManager.getLookAndFeel().getName().equals(platform)) {
try {
UIManager.setLookAndFeel(platform);
} catch (Exception exception) {
exception.printStackTrace();
}
}
}