Reputation:
I set up netBeans and a SceneBuilder on my new MacBook M1 and everything works, except of the font when running the program.
It looks like this:
and I have no clue why. The Button should say: "Click me" and the Label: "Hello".
The Error message I get is:
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:].
Upvotes: 4
Views: 6341
Reputation: 1
You can install the AdoptOpenJDK from this link https://formulae.brew.sh/cask/adoptopenjdk (Note: you need to have Brew installed).
Then you go to the project module settings and then go to 'Project'. There you will see the label 'SDK'. Click there and next select 'Add JDK'. It will redirect you to the JDKs and next select the 'AdoptOpenJDk' folder.
Upvotes: 0
Reputation: 31
I was able to resolve the issue by adjusting the JDK version. Although I did not have JDK 8, JDK 14 worked fine and JDK 17 did not. It will work fine if you change the project structure to a more compatible JDK version with JavaFX.
Upvotes: 1
Reputation: 31
In my case that crap came up when I run programm on mac (on pc was all good).
For me shortest way to solve this was one record in stylesheet:
.root{
-fx-font-size: 11pt;
-fx-font-family: "Arial";
}
Upvotes: 3
Reputation: 9
I have also switched my Module setting back to : 11.0.8 instead of 11.0.12 as shown below:
Upvotes: 1
Reputation: 11
In my case, I was using the JavaFX 11 with the JDK11 and that was giving the weird characters, so I changed it to JavaFX 16 and also started using the JDK16 and that fixed my problem!
Upvotes: 1
Reputation: 96
I also had the same issue, but in my case, the problem was with JDK 11. First, I tried to switch to JDK 8 and everything worked fine, but then I found that another version of JDK 11 (AdoptOpenJDK(HotSpot) 11) also fixes it.
Upvotes: 5