欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Java LookAndFeel之Substance的设置

程序员文章站 2022-07-13 12:33:44
...
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());
		}
	}

效果示例:

Java LookAndFeel之Substance的设置
            
    
    博客分类: Swing JavaITeye 

  • Java LookAndFeel之Substance的设置
            
    
    博客分类: Swing JavaITeye 
  • 大小: 65 KB
相关标签: Java ITeye