how to add sinhala to java GUI

Hi.. i think every programmer must aware about there own Unicode formats and how to add Unicode to their own program.I am going to say you how to enable java GUI with Sinhala Unicode values.

I am using Netbeans IDE and Java Development Kit 1.7 for develop Java programs.

Create a new form using Netbeans and add a Button from Swing containers. Then go to font item change it in to Iskoola pota. I used that Unicode font in my Program. See the image below

Then add a text to button as Unicode ( Sinahala ) format. You just copy the words from else where and paste it it text field. You will see something like \u0d86\u0dba values such as above my picture. Don’t worry in run time it will look like  as below picture.

Now you must be happy.

To view in Sinhala you must install the Sinhala Unicode for your computer. Other wise you will see some boxes in your button.

OK now you have done a Unicode based Java application using Java.

37 thoughts on “how to add sinhala to java GUI

  1. mamath use karanne java 1.7… bt netbeans wala yansaya niyama widiyata pennnanne ne… ekata monahari piliyamak thiyanawada

  2. netbeans wala JTABLE ekak title ekak sinhalen liyanne kohomada? ethanata sinhala gannama ba wage. man try kala. anith ona thanakata sinhala enawa. eth JTable eke Title ekata sinhala ganna ba. ehema ganna puluwanda????

    • Thank you Very much Brother..!!! Thumbs Up..!! It works..!! Its very fond of you because you are doing a great thing to our little country by using your blog…. Keep It up!!!!! Thnx again…

  3. I have a code like this in a button click event
    String str=”\u0d85″;
    this code suppose to show the “අ” in the textbox as well as in the output dial. but it shows empty character boxes (u know the thing they show when the image is missing or unidentified) instead. But i have added sinhala characters to the button successfully. how can i fix this.
    forgot to tell im using netbeans latest version by the way

  4. ජාවා ලේබල් හා ටෙක්ස් බොත්ස් වල සිංහල යුනිකෝඩ් ඉස්කෝල පොත ෆොන්ට් එකේ රකාරංශය යෙදු අකුරු ටයිප් කරන්න බෑ

    • Swing වල වැඩ කරන්නේ නම් නැහැ. ඒ උනාට SWT වල වැඩ කරනවා. try කරලා බලන්න. හැබැයි එකේ code කරන විදිහ වෙනස් ගොඩක්.

      • It works really well on my Windows Xp Service Pack 3 computer. Here is a screenshot.

        Note: I have changed the Default icon appearing in SWT Shell to the java cup icon.

        මගේ Windows Xp Service Pack 3 computer එකේ හොඳට වැඩ කරනවා. මේ තියෙන්නේ screenshot එකක්.

        Note: මම SWT Shell එකේ Default icon එක java cup icon එකට මාරු කරලා තියෙන්නේ මේ example එකේ.

  5. එල බං.සිංහල උන්ට unique ජාවා problem ගොඩ දාගන්න මේ blog එක කරගෙනේ යනවට.

    • Character Encoding එක UTF8 වලට සෙට් කරගන්න. එතකොට හරි. Windows OS එකේදී තමයි සේරම ගැටළු. Linux වල කිසිම ගැටළුවක් නැහැ.

  6. Java net beans jlable ekkata sinhala font dammama eka ok. but sinhala font nathi PC ekka eka run karaddi boxes pennanne. kohomada eka compatible karanne?

  7. Jlable ekkata properties walin sinhala font danna puluwan. but e app eka kohomada wena PC ekka awlak nathiwa run karanne..I mean e sinhala font eka nathi PC ekka run karaddi boxes enne nathi wenna run karanne kohomada???


      Java won’t ever support that kind of thing (as they once stated officially), as char data type is 16 bit only. Sun micro systems had no effort making char data type a 32bit and neither does Oracle. The real reason behind that decision is it that they fear it might break the existing systems after that kind of a major change to the language system, not an enhancement. Additionally, they don’t plan to introduce new data type as well.

      For a solution, may I suggest you to use SWT used by the eclipse, not Swing used by Netbeans IDE. it is available from website.

      Best Regards,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.