繁体   English   中英

如何更改 netbeans 平台中的默认字体?

[英]How to change default font in netbeans platform?

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

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

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

和/或与

要么

看看@camickr 默认的 UImanager

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM