导入架包后,在main函数里加入下面的代码:
public static void main(String[] args)
{
// 装载可选择的主题
try {
//设置外观
UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel());
JFrame.setDefaultLookAndFeelDecorated(true);
//设置主题
SubstanceLookAndFeel.setCurrentTheme(new SubstanceEbonyTheme());
//设置按钮外观
SubstanceLookAndFeel.setCurrentButtonShaper(new ClassicButtonShaper());
//设置水印
SubstanceLookAndFeel.setCurrentWatermark(new SubstanceBinaryWatermark());
//设置边框
SubstanceLookAndFeel.setCurrentBorderPainter(new StandardBorderPainter());
//设置渐变渲染
SubstanceLookAndFeel.setCurrentGradientPainter(new StandardGradientPainter());
//设置标题
SubstanceLookAndFeel.setCurrentTitlePainter(new FlatTitlePainter());
} catch (Exception e) {
System.out.println(e.getMessage());
}
}