2

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

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

4

2 回答 2

3

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

和/或与

或者

看看@camickr 默认的 UImanager

于 2012-09-28T09:46:54.260 回答
0

如果您正在寻找更改平台应用程序中的“编辑器”字体,(我确实在我的平台应用程序中使用了一些 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:你也可以在这里查看来源

于 2020-03-24T08:20:23.767 回答