By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,956 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,956 IT Pros & Developers. It's quick & easy.

Japense text on a JButton

P: n/a
Is it possible to do at all? The software will be used on computers
with western operative systems (so i guess, JVM will be english)
but i'm asured that japanese will be enabled through IME so that
all fonts-and-company are installed.

--

Kindly
Konrad
---------------------------------------------------
May all spammers die an agonizing death; have no burial places;
their souls be chased by demons in Gehenna from one room to
another for all eternity and more.

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------


Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Come to think of one more thing. The code is something like:

import javax.swing.*;
import java.awt.*;

public class Japanese extends JFrame {
public Japanese () {
JButton butt= new JButton ("\u4eca\u65e5\u306f");
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment
();
butt.setFont (new Font ("Arial Unicode MS", Font.BOLD, 8));
this.getContentPane ().add (butt);
this.setVisible (true);
}

public static void main (String[] arg) {
new Japanese ();
}
}

The problem is that the only characters i get to see are squares... What do
i miss?!

--

Kindly
Konrad
---------------------------------------------------
May all spammers die an agonizing death; have no burial places;
their souls be chased by demons in Gehenna from one room to
another for all eternity and more.

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------


Jul 17 '05 #2

P: n/a
Disregard my question, please. The hardly intelligent dumbass
(that would be me) forgot to change the "Arial Unicode MS"
to "MS Mincho" (the name of the japanese font).

This one tops my doh-list of 2004 this far...
Talking about waste of bandwidth...

--

Kindly
Konrad
---------------------------------------------------
May all spammers die an agonizing death; have no burial places;
their souls be chased by demons in Gehenna from one room to
another for all eternity and more.

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sense to be lazy
---------------------------------------------------


Jul 17 '05 #3

P: n/a
Yes, it is possible. (Possible on many different OSs, when proper fonts
are installed on client)

You will need to insure that the Japanese character fonts for the OS are
installed, and
you must use the international version of the J2SE (JRE) which includes
the Japanese
i18n Font properties.

Konrad Den Ende wrote:
Is it possible to do at all? The software will be used on computers
with western operative systems (so i guess, JVM will be english)
but i'm asured that japanese will be enabled through IME so that
all fonts-and-company are installed.

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.