导入配置jar包 substance.jar
然后在frame的主函数 加入如下代码
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
try {
UIManager.setLookAndFeel(new org.jvnet.substance.skin.SubstanceModerateLookAndFeel()) ;
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
FontUIResource f = new FontUIResource("", Font.PLAIN, 14);
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource){
UIManager.put(key, f);
}
}
然后即可以美化界面