When I create a new JLabel, I get the following error log in the console:
Warning: the fonts "Times" and "Times" are not available for the Java logical font "Serif", which may have unexpected appearance or behavior. Re-enable the "Times" font to remove this warning.
But I do not use this (default) font.
How can I solve this problem or at least suppress the message?
StringBuilder sb = new StringBuilder();
// sb gets some text here
// ...
JLabel label = new JLabel();
label.setFont(new Font("Classic Console Neue", Font.PLAIN, 18)); // changed font to a valid font
label.setText(sb.toString()); // this line will cause the log entry, but why?
A workaround would be to install the Times.ttf on every target computer, but that is not practicable.