class Action implements ActionListener
{
public static String text_str;
public Action ()
{}
public void actionPerformed(ActionEvent e)
{
JTextField text=(JTextField)e.getSource();
//String name=e.getActionCommand();
text_str =text.getText();
System.out.println(text_str);
//System.out.println(name);
}
}
转载于:https://blog.51cto.com/shuoailin/1436252