2

I'm trying to change the font of my Substance applet.

In the documentation over at Substance look and feel - dark skins the titlebars have a custom font. I've read through the documentation for anything about setting the font, without any result.

This is how my title looks right now:

How do I change the Substance/JFrame titlebar font?

4

1 回答 1

0

从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;
    }
});
于 2015-12-14T19:13:52.163 回答