title: Get value of field in DefaultTableModel in JAVA
body: <p><strong>The user has chosen value of a field in a row,How i can get value of id field in row that chosen?
  For example,user select value of name field in row 2,I want understand the value of id field in row 2.How should write in TableModelListener?</strong></p>
  
  <pre><code>public class Main {
      public static DefaultTableModel model;
  
      public static void main(String[] args) throws Exception {
          model = new DefaultTableModel();
          JFrame frame = new JFrame("Creating a Scrollable JTable!");
          JPanel panel = new JPanel();
          model.addColumn("id");
          model.addColumn("name");
          model.addColumn("family");
          Class.forName("oracle.jdbc.driver.OracleDriver");
          java.sql.Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "SYSTEM", "1234");
          PreparedStatement st = con.prepareStatement("select * from person");
          ResultSet r = st.executeQuery();
          while (r.next()) {
              model.addRow(new Object[]{r.getString("id"), r.getString("name"), r.getString("family")});
          }
          st.close();
          con.close();
          model.addTableModelListener(new TableModelListener() {
              public void tableChanged(TableModelEvent e) {
                  System.out.println(model.getValueAt(e.getFirstRow(), e.getColumn()));
              }
          });
          JTable table = new JTable(model);
          frame.add(panel);
          panel.add(table);
          frame.setVisible(true);
      }
  }
  </code></pre>