How to show Bengali text properly

前端 未结 1 1888
梦谈多话
梦谈多话 2021-01-11 22:07

I have a JTextArea where I need to show Bengali text like:

বাংলাদেশ

But all I can see is rectangular boxes. How can

相关标签:
1条回答
  • 2021-01-11 22:51

    First take a bangla unicode supported font like:

    Font banglaFont=new Font("Arial Unicode MS", Font.BOLD,15);
    

    Then attach it to your JTextArea object using setFont

    text1.setFont(banglaFont);
    

    Now you should be able to view bangla properly, give a try.

    NOTE: Java uses font from the system , so if the system doesn't contain a specific font then you can deploy that font within your application using Font.createFont().

    0 讨论(0)
提交回复
热议问题