import java.awt.Font;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class HelloInJapanese extends JPanel {
static JFrame frame;
static String helloInJapanese = "\u4eca\u65e5\u306f.";
public HelloInJapanese(String characters) {
JTextArea area = new JTextArea(characters, 2, 30);
area.setFont(new Font("Bitstream Cyberbit", Font.PLAIN, 20));
area.setLineWrap(true);
JScrollPane scrollpane = new JScrollPane(area);
add(scrollpane);
}
public static void main(String argv[]) {
HelloInJapanese japanesePanel = new HelloInJapanese(helloInJapanese);
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add("Center", japanesePanel);
frame.pack();
frame.setVisible(true);
}
}
|