Swing GUI编码读取Amharic字符

时间:2017-05-15 08:05:57

标签: java swing

如何修复此代码以阅读amharic语言?

import java.awt.FlowLayout;
import javax.swing.JButton;`
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class Gui {

    public static void main(String[] args) {
       SwingUtilities.invokeLater( () -> new Gui().start() );
    }

    public void start() {
        JFrame frame = new JFrame(" አማረኛ ");
        JButton btn = new JButton(" ስላም ");
        JButton btn2 = new JButton(" ሃይ");

        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().setLayout(new FlowLayout(FlowLayout.LEFT));
        frame.getContentPane().add(btn);
        frame.getContentPane().add(btn2);
        frame.setSize(250, 220);
        frame.setVisible(true);
    }

}

click this link the output look like this Image

1 个答案:

答案 0 :(得分:0)

您可以尝试使用Unicode符号。例如:

JButton btn = new JButton(" \u1235\u120B\u137F ");

您可以通过简单的Google搜索找到这些代码。 试试这样:“ሃunicode”
找到代码的十六进制值(最后4位数)并在开头添加“\ u”。

相关问题