updating the value in frame1 if changed in frame2
hi,
i have two frames....frame 1 has button calculate....frame 2 has button update which can update the data on frame two.....so the scene can be like that user might or might not want to update data on form 2 but in either case will calculate.....The approach that i was thinking of is that if i update it i store it in a JtextField2 on frame2 ...read the value in frame1 and compare with the value when updated wasnt hit....if values are same the result can be the standard value else it will store the value from JtextField.....now i have a question....
1) is this approach fine?.....How can i tell calculate that Update was hit or not?...is there any way by which i can get that a button in frame2 was hit or not?
privatevoid jButtonAction2Performed(java.awt.event.ActionEvent evt){
table1 t1 =new table1();//frame 2
String a1 = t1.jTextField1.getText();//frame2....reads the data from textfield 1
String a4 = jTextField1.getText();//frame1
double anum1, anum4;
anum1 = Double.parseDouble(a1);
anum4 = Double.parseDouble(a4);
double asum = anum1*anum4 ;
System.out.println("i am NOT UPDATED value--> "+asum );
String tabsum = t1.jTextField2.getText();//text field2 has the updated value of the product with which asum will be compared
double tsum1 = Double.parseDouble(tabsum);
System.out.println("i am UPDATED value--> "+tsum1);
for some reason it is not reading the content of jTextField2 of frame2 and showing the error -> Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "jTextField2"
Thanks

