#5, First Floor, 4th Street , Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to use Tamil font in java?

Description

The code given below demonstrates the usage of Tamil Font (Latha) in java by applying Unicode for each character in Tamil and displays the font in container using applet.

Sample Code
  • Filename: TamilFont.java

import java.io.*;
import javax.swing.*;
import java.awt.*;
public class TamilFont extends JApplet {
public void init()
{
String content="\u0BB5\u0BA3\u0B95\u0BCD\u0B95\u0BAE\u0BCD";
Container container=getContentPane();
container.setLayout(new FlowLayout());
JLabel label1=new JLabel();
label1.setFont(new Font("Latha",Font.PLAIN,12));
label1.setText(content);
container.add(label1);
}
}


Screenshots