Passing data to new GUI
<p>I have a <code>JTable</code> with contents on it which I have read from a CSV file. I am using the following method which when I click on a row it will open up a new <code>JFrame</code> and close the previous one. It will display things such as ID, co-ordinates, status of what is written on that table and can edit them if wanted. E.G. table below:</p>

<pre><code>|ID  |co-ordinates      | status   | 
| 1  |   (3,21)          |  pending | 
|  2 |  (4,21)           | full     | 
|  3 |  (9, 12)          |  empty   |
</code></pre>

<p>If I click row 1, it will pop up with frame of the ID(1), co ordinates(3,21) and status in a text field in another frame and is editable. I am able to do the clicking function but am not sure how to take that data onto the next frame when clicking the row. </p>

<pre><code> //in location class
 table.addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent e) {
                  if (e.getClickCount() == 1) {
                    int row = table.getSelectedRow();
                    AddEdit An = new AddEdit(); //goes to next class 
                    An.setVisible(true);
                    dispose();
                }
             }
          });
</code></pre>

<p>How to take that data onto the next frame, when clicking the row?</p>