I am trying to print unicode in a JTextArea. I have gotten it to print fine to the console but when I try to print it to the textarea, I get boxes for all of the two byte unicode characters. Any help would be much appreciated.
package edu.afit.jieddo;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class JTextAreaDemo extends JFrame {
StringBuffer m = new StringBuffer("\u14c7 \u14c4 \u1557 \u00d6");
StringBuffer m2 =new StringBuffer(" means one.");
String message = m.append(m2).toString();
public JTextAreaDemo() {
super("\u14c7 \u14c4 \u1557 \u00d6");
java.awt.Font font = new java.awt.Font("Arial Unicode MS", java.awt.Font.PLAIN, 18);
JTextArea textArea = new JTextArea(message);
textArea.setFont(font);
java.awt.Container container=this.getContentPane();
container.add(textArea);
System.out.println(textArea.getFont().getFamily());// testing output in the command line
}
public static void main(String[] args) {
JTextAreaDemo frame = new JTextAreaDemo();
frame.setFont(new Font("Arial Unicode MS",Font.ITALIC,11));
frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
System.out.println("\u14c7 \u14c4 \u1557 \u00d6");
System.out.println(frame.getFont().getFamily());//testing output in the command line
}
}