title: Problem in passing value of JTable cell of one JFrame form to another form's JTextField
body: <p><br>
  I have two JFrame Forms-SelectContactsfrm.java and Taskfrm.java. There is JTable in SelectContactsfrm file to show the contacts.When user select a contact from JTable and when he/she press OK button,selected values should be copied into Taskfrm.java's JTextField.  </p>
  
  <p>Taskfrm.java's JTextField's name is-txtContacts and access modifier is-public</p>
  
  <p>Below is the code which I wrote on SelectContactsfrm's OK button's actionPerformed.Button name-btnOK  </p>
  
  <pre><code>private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {
      // Code to get the selected rows value and paste Contact's full name in Taskfrm's txtContacts JTextField:        
  
      selrow=ctable.getSelectedRow();
      selcol=ctable.getSelectedColumn();
      Object value=ctable.getModel().getValueAt(selrow,1);
      new Taskfrm().txtContacts.setText(value.toString());                                                            
  
      //Just to check whether I get the correct values or not.                                      
      System.out.println("selrow=="+selrow);
      System.out.println("selcol=="+selcol);
      System.out.println("txtContacts=="+value);
  
  }  
  </code></pre>
  
  <p>I can see the correct selected values in output but didnt get why this value has not been set in Taskfrm's JTextField.In Taskfrm's constructor only initComponents() is there.Is there any way to attach class files here instead of pasting? </p>