I am instantiating a class with jtextfield on it and place it in a desktoppane. If for example, I instantiated this class 5 times, how could I get the values from the textfields of different windows? The only values that were returned are from the last instantiated class even I put focus on the first to fourth windows.
Child ch;
JInternalFrame ji;
ch=new Child();
public void createWindow(){
ji = new JInternalFrame(ch.getTitle(),true,true,true,false);
ji.setName(""+x);
ji.add(ch.getRootPane());
ji.setLocation(20*x, 20*x);
jDesktopPane1.add(ji);
ji.pack();
ji.setVisible(true);
x++;
}
public void showInput(){
System.out.println(ch.jTextField1.getText());
System.out.println(ch.jTextField2.getText());
}