The Swing program shows wrong characters instead of German umlauts. This button should be "Schließen", for example:
. This occurs for all UI elements as far as I can see.
The code to create the UI is nothing unusual, for example:
about = new JButton("");
about.setToolTipText("Über das Programm");
I already checked following things:
- The encoding of the .java files is utf-8 (checked with VS code)
- The font is javax.swing.plaf.FontUIResource[family=Dialog,name=Dialog,style=bold,size=12]. Dialog appears to be the default font, so it would be strange if it did not support umlauts. But I have not found a way to check this, because when I check my installed fonts through windows I don't find a font called "Dialog".
The project also uses gradle (6.8).
What could be a reason for this behaviour? When I talked to somebody who compiled the same program on Linux they didn't seem to have this problem.
Edit:
I also found code such as this:
JLabel test = new JLabel();
test.setFont(new Font("Arial", Font.PLAIN, 12));
test.setText("<html>Something with ß</html>");
Arial surely supports umlauts, but this code still did not display the ß correctly