Java JTextFiled Font: How to show Bangla (Bengali) in JTextField

Here I have share you a solution to show the Bengali (Bangla) font in java JTextField.

Code Example:

import java.awt.*;

import javax.swing.*;

public class BanglaFont extends JFrame

{

JTextField text2;

                        public BanglaFont()

                        {

                        Font displayFont1=new Font(“SutonnyMJ”, Font.BOLD,15);

                        setSize(300,200);

                        setTitle(“JTextField Font”);

                        setDefaultCloseOperation(EXIT_ON_CLOSE);

                        JPanel panel=new JPanel();

                        getContentPane().add(panel);

                        panel.setLayout(null);

                        text2=new JTextField(“Kw¤úDUvi”);

                        text2.setFont(displayFont1);

                        text2.setBounds(100,40,100,30);

                        panel.add(text2,BorderLayout.WEST);

                        }

                        public static void main(String args[])

                        {

                        BanglaFont x=new BanglaFont();

                        x.setVisible(true);

                                    }

                                      }
OUTPUT:

JTextField Font Bangla

One Response to Java JTextFiled Font: How to show Bangla (Bengali) in JTextField

  1. tomal says:

    Nice Post… its really helpful. But one thing how i can set title with Bangla font.

    Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s