Using JTextField data to display Chinese Character
807607Dec 23 2006 — edited Dec 25 2006Hi,
I am new to Java programming, currently using NetBeans for this GUI application that i am developing and I had a problem of displaying a Chinese Character while using the data from JTextField.
==================== P r o b l e m =========================
//hardcoding the following will display a chinese character in the JPanel
Graphics g = null;
g.setFont(new Font("AR PL ZenKai Uni",Font.PLAIN, 32));
g.drawString("\u6c32",100,100);
//However, if i were to use the information from JTextField, i will get \u6c32 if i type that in the JTextField. The following codes illustrates the problem.
Graphics g = null;
String str = new String();
str = jTextField1.getText();
g.setFont(new Font("AR PL ZenKai Uni",Font.PLAIN, 32));
g.drawString(str,100,100);
Please enlighten me, thanks!
Shoker