title: Java Getting JTable Value (Per row)
body: <p>I would like to get the value from the Jtable, and I tried it using the getvalueat however whenever I try to get the value from the JTable it only get the value from the first column of the selected row, I need to get all the value from the Jtable which I selected. Can you please help me with this one</p>
  
  <pre><code>here is my code:
  class GetTableValue implements ActionListener{
      public void actionPerformed(ActionEvent e){
          AbstractButton button = (AbstractButton)e.getSource();
          if(e.getActionCommand().equals(button.getActionCommand)){
              int row = table.getSelectedRow();
              int col = table.getSelectedColumn();
  
              Object data = (Object)table.getValueAt(row, col);
              JOptionPane.showMessageDialog(null, data);
          }
      }
  }
  </code></pre>
  
  <p>This is my action event where the value of the selected table is shown in the JOptionPane unfortunately it only display one value(which is the one you already selected) not the whole row.</p>
  
  <p>This code is for my Jbutton for call the action event(I already excluded my code from the JTable since it fetch the Jtable value from my database)</p>
  
  <pre><code>ActionListener tableAction = new GetTableValue();
  
  
  buttonEdit = new JButton("EDIT");
  
  
  buttonEdit.addActionListener(tableAction);
  </code></pre>
  
  <p>the code is plain and simple, I also search Mr. G(google) about a good tutorial on fetching row, unfortunately there isn't a good tutorial for fetching Jtable value(per row).</p>