Swing/AWT garbled solution developed in Java in Linux

Source: Internet
Author: User
Problem description:
Java ProgramThe Chinese display in the swing/AWT component in is a box, while the title can display Chinese normally, and the system. Out. println ("Chinese string") can be used to display Chinese normally;
It may be caused by the unsupported JRE Chinese font, so you can add a supported Chinese font.
Step 1: Download the Chinese font. I use simsun. TTC, which can be found directly in Windows (My XP system is used). The input path is simsun under C: "Windows" fonts. TTC
You can also download the recommended Skynet website from the website:
Http://file.tianwang.com/cgi-bin/search? WORD = simsun. TTC

Step 2: Place simsun. TTC In the JRE Font Library as follows:
CD <java_home>/lib/fonts or CD <java_home>/JRE/lib/Fonts
Mkdir fallback (fallback indicates the folder for storing the backup LANGUAGE)
<Java_home> is the path to install JDK/JRE, and mine is/usr/lib/jdk1.5. Copy or link a Chinese font to it:
Ln-S/usr/share/fonts/TrueType/simsun. TTF/usr/lib/jdk1.5/JRE/lib/fonts/fallback/simsun. TTF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.