Display unicode text : Text « 2D Graphics GUI « Java

Display unicode text


import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class RussiaUnicode extends JPanel {
  public void paint(Graphics g) {
    Graphics2D g2d = (Graphics2D) g;
    g2d.drawString("\u0424\u0451\u0434\u043e\u0440.", 20, 30);

  public static void main(String[] args) {
    JFrame frame = new JFrame("Unicode");
    frame.add(new RussiaUnicode());
    frame.setSize(520, 220);


Related examples in the same category

1.Create a shadowed text
2.Draw 2D Text
3.Drawing Simple Text
4.Drawing Rotated Text
5.Draw string rotated clockwise 45 degrees
6.Draw string rotated counter-clockwise 45 degrees
7.Getting the Dimensions of Text
8.Display underlined text
9.Display vertical text
10.Use AffineTransform to draw vertical text
11.Have a Label with underlined text
12.Display some lyrics on the panel.
13.drawString(): specify the position of the text on the window areadrawString(): specify the position of the text on the window area
14.Rotate a line of character (String)
15.Generate Shape From Text