たとえば、両方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();
}
できれば提案してください