【发布时间】:2021-06-27 16:54:39
【问题描述】:
我在我的新 MacBook M1 上设置了 netBeans 和 SceneBuilder,一切正常,除了运行程序时的字体。
看起来像这样:
我不知道为什么。 按钮应该说:“点击我”和标签:“你好”。
我得到的错误信息是:
März 31, 2021 6:33:04 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 16 by JavaFX runtime of version 11.0.2
2021-03-31 18:33:05.466 java[4349:140717] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2021-03-31 18:33:05.466 java[4349:140717] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2021-03-31 18:33:05.471 java[4349:140717] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2021-03-31 18:33:05.641 java[4349:140751] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
【问题讨论】:
-
所以我让它以正确的方式工作。我将 SceneBuilder 中的字体更改为“SansSerif”,现在它显示了应该显示的文本。但我仍然收到一个警告:Loading FXML document with JavaFX API of version 16 by JavaFX runtime of version 11.0.2
-
好的,所以我也修复了它。在我的 FXML 中,我输入: xmlns="javafx.com/javafx" xmlns:fx="javafx.com/fxml/1" 而不是 xmlns="javafx.com/javafx/16" xmlns:fx="javafx.com/fxml/1"
标签: java netbeans fonts scenebuilder