Solved

Displaying Chinese Characters in Java Applet

Posted on 2001-08-14
7
755 Views
Last Modified: 2013-12-03
Hello, does anybody know how to display chinese characters on an applet's GUI? I try to just input chinese unicode in the various GUI components but it sometimes comes out as unicode characters and if if use a chinese viewer program, it comes out as squares.

Is there anyway to have chinese character display in an applet without the use of any external chinese viewer program such as NJStar etc. ?

0
Comment
Question by:jerntat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6383347
You need to have the necessary fonts installed not only on your machine but also in the jre being used.
There is doco at java.sun.com on how to make fonts available to the jre.
0
 

Author Comment

by:jerntat
ID: 6383549
I have already done that but didnt get anything out.I have tested on the following code:

public class TestApplet extends JApplet
{
  public void init(){
  }

  public void start(){
    String abc = "\u4f60\u597d\u4e16\u754c";
    JOptionPane.showMessageDialog(null, abc);
  }
}

I have also tried compiling using encoding.
0
 
LVL 92

Expert Comment

by:objects
ID: 6386566
Have you tried setting the component to use your chinese font via setFont().
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jerntat
ID: 6386686
no. How do you do that?
0
 
LVL 92

Expert Comment

by:objects
ID: 6386731
component.setFont(mychinesefont);
0
 
LVL 92

Accepted Solution

by:
objects earned 50 total points
ID: 6386745
0
 
LVL 92

Expert Comment

by:objects
ID: 6395302
Thanks for the points :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 161
Java: anonymous class 4 55
Why doesn't this text field show up on my Applet frame? 2 43
Setup Eclipse for Andriod development 2 21
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question