请问如何获取JTextField中的值,多谢
------解决方案--------------------
JTextField usertext=new JTextField()
……
……
String username=usertext.getString();
------解决方案--------------------
public class A{
JTextField usertext=new JTextField( "nihao ");
public JTextField getUsertext() {
return usertext;
}
}
--------
public class B{
public static void main(String[] args) {
String str;
A c = new A();
str = c.getUsertext().getText();
System.out.println(str);
}
}