phenomena
Swing to write the interface, feel too ugly, using WEBLAF changed the interface. But Chinese is always garbled.
If you do not use WEBLAF, it is normal. reason
Google took a look at the project home page.
The Swing default font has Chinese.
The default font set by Weblaf does not have Chinese in it.
The system can not find Chinese characters in the font, the display garbled.
This is the default font setting for Com.alee.laf.WebFonts
static {
if (systemutils.iswindows ()) {
fonts.put ("Control", New Fontuiresource ("Tahoma", 0,));
Fonts.put ("alert", New Fontuiresource ("Segoe UI", 0);
Fonts.put ("menu", New Fontuiresource ("Segoe UI", 0);
Fonts.put ("accelerator", New Fontuiresource ("Segoe UI", 0,));
Fonts.put ("title", New Fontuiresource ("Segoe UI", 0);
Fonts.put ("text", New Fontuiresource ("Tahoma", 0,));
Fonts.put ("tooltip", New Fontuiresource ("Segoe UI", 0,));
else if (....
//...
}
See also: Unicode support? Solving Method
Set the font in the Weblaf yourself.
As the following code, set to the script. Chinese is displayed normally.
Weblookandfeel.globalcontrolfont = new Fontuiresource ("Official script", 0); Weblookandfeel.globaltooltipfont
// Weblookandfeel.globalalertfont
// Weblookandfeel.globalmenufont
// Weblookandfeel.globalacceleratorfont
// Weblookandfeel.globaltitlefont
// Weblookandfeel.globaltextfont
weblookandfeel.install ();