【问题标题】:How to change default font in netbeans platform?如何更改 netbeans 平台中的默认字体?
【发布时间】:2012-09-20 04:13:44
【问题描述】:

我想知道如何更改 netbeans 平台中使用的默认字体。我不是要求在 Netbeans IDE 中更改字体,而是在 platform 中更改字体,然后我的所有派生应用程序都将使用此默认字体。

netbeans 应用程序是一组 Jcomponent,因此我可以轻松设置每个组件的字体,但仍有一些东西,例如 notifications,我无法访问直接更改字体,所以我认为最好的方法是默认更改字体。以编程方式或任何其他方式...也许编辑一个 jar?

【问题讨论】:

  • “派生应用程序”是什么意思?

标签: java swing netbeans fonts uimanager


【解决方案1】:

Font 的类型和大小与platform 和使用的Look and Feel 不同,有这些可能性

和/或与

看看UImanager default by @camickr

【讨论】:

    【解决方案2】:

    如果您希望更改平台应用程序中的“编辑器”字体,(我确实在我的平台应用程序中使用了一些 NB 编辑器),这就是方法。

    创建一个文件org-netbeans-modules-editor-settings-CustomFontsColors.xml,内容如下,

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE fontscolors PUBLIC "-//NetBeans//DTD Editor Fonts and Colors settings 1.1//EN" "http://www.netbeans.org/dtds/EditorFontsColors-1_1.dtd">
    <fontscolors>
        <fontcolor bgColor="white" foreColor="black" name="default">
            <font name="Noto Serif CJK JP" size="15"/>
        </fontcolor>
    </fontscolors>
    

    在你的 layer.xml 文件中,

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
    <filesystem>
         <folder name="Editors">
            <folder name="NetBeans">
                <folder name="Defaults">
                    <file name="defaultColoring.xml" url="org-netbeans-modules-editor-settings-CustomFontsColors.xml"/>
                </folder>
            </folder>
         </folder>
    </filesystem>
    

    就是这样。

    PS:你也可以查看来源here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-23
      相关资源
      最近更新 更多