例如,两者class
都在同一package
class A extends JFrame{
public JTextField username = new JTextField;
A a = new A();
------------------------------
------------------------------
}
class B extends JFrame{
String user;
// i am able to acess like this
user = new A().username.getText();
//but i want to acess like followin and its not working
user = a.username.getText();
}
如果可以的话建议我