【问题标题】:Setting Substance Titlebar Font设置物质标题栏字体
【发布时间】:2015-04-19 19:06:03
【问题描述】:

我正在尝试更改我的 Substance 小程序的字体。

Substance look and feel - dark skins 的文档中,标题栏具有自定义字体。我已经阅读了有关设置字体的任何文档,但没有任何结果。

这就是我的标题现在的样子:

如何更改 Substance/JFrame 标题栏字体?

【问题讨论】:

    标签: java swing look-and-feel substance


    【解决方案1】:

    来自 OP 的编辑:

    SubstanceLookAndFeel.setFontPolicy(new FontPolicy() {
        public FontSet getFontSet(String arg0, UIDefaults arg1) {
            FontSet fontSet = new FontSet() {
                public FontUIResource getWindowTitleFont() {
                    return new FontUIResource(new Font("Serif", Font.PLAIN, 12)); //this is where the title font changes
                }
    
                public FontUIResource getTitleFont() {
                    return new FontUIResource(new Font("Arial", Font.PLAIN, 12));
                }
    
                public FontUIResource getSmallFont() {
                    return new FontUIResource(new Font("Arial", Font.PLAIN, 12));
                }
    
                public FontUIResource getMessageFont() {
                    return new FontUIResource(new Font("Arial", Font.PLAIN, 12));
                }
    
                public FontUIResource getMenuFont() {
                    return new FontUIResource(new Font("Arial", Font.PLAIN, 12));
                }
    
                public FontUIResource getControlFont() {
                    return new FontUIResource(new Font("Arial", Font.PLAIN, 12));
                }
            };
            return fontSet;
        }
    });
    

    【讨论】:

      猜你喜欢
      • 2019-10-28
      • 2016-01-30
      • 1970-01-01
      • 2015-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多