JTextField Unicode Problem

Discussion in 'Java' started by Badshah, Jan 29, 2007.

  1. Badshah

    Badshah Guest

    I am not able to get "♣" symbol on console when I press enter in jtf
    after inserting "♣".

    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.sql.*;

    public class TestFrame
    {
    JTextField jtf = null;
    public TestFrame()
    {
    try
    {
    JFrame fr = new JFrame("Testing Unicode Transfer From & To MySql
    Database");
    JPanel cp = new JPanel();
    fr.setContentPane(cp);
    cp.setLayout(null);

    fr.setBounds(0,0,400,400);

    jtf = new JTextField();
    cp.add(jtf);
    jtf.setBounds(20,300,100,40);

    jtf.addActionListener(new ActionListener()
    {
    public void actionPerformed(ActionEvent ae)
    {
    System.out.println(jtf.getText());
    }
    });
    fr.setVisible(true);
    }
    catch(Exception ex)
    {
    System.out.println("Exception : " + ex);
    }
    }
    public static void main(String args[])
    {
    new TestFrame();
    }
    }
     
    Badshah, Jan 29, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Katie Moore

    JTextField Problem

    Katie Moore, Dec 1, 2003, in forum: Java
    Replies:
    1
    Views:
    490
    Harald Hein
    Dec 1, 2003
  2. Matthew Bailey

    JTextField.requestFocus problem

    Matthew Bailey, Jul 6, 2004, in forum: Java
    Replies:
    4
    Views:
    8,037
    Matthew Bailey
    Jul 8, 2004
  3. blue
    Replies:
    1
    Views:
    1,196
    Babu Kalakrishnan
    Dec 11, 2004
  4. Badshah

    JTextField Unicode Mysql

    Badshah, Jan 27, 2007, in forum: Java
    Replies:
    16
    Views:
    939
  5. Badshah

    JTextField Unicode Problem

    Badshah, Jan 29, 2007, in forum: Java
    Replies:
    2
    Views:
    1,172
    Badshah
    Jan 30, 2007
Loading...

Share This Page