B
Badshah
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();
}
}
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();
}
}