Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Displaying Chinese Characters in Java Applet

Posted on 2001-08-14
7
Medium Priority
?
784 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 

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 200 total points
ID: 6386745
0
 
LVL 92

Expert Comment

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

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to implement Singleton Design Pattern in Java.

722 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