[英]Swing GUI encoding to read Amharic characters
如何解決此代碼以閱讀阿姆哈拉語?
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);
}
}
您可以嘗試使用Unicode符號。 例如:
JButton btn = new JButton(" \u1235\u120B\u137F ");
您可以通過簡單的Google搜索找到這些代碼。 像這樣嘗試:“ሃunicode”
查找代碼的十六進制值(后4位),並在開頭添加“ \\ u”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.