Bem galera, é assim: Ao clicar em alguma célula da tabela, vai ser mostrado o valor que tem dentro em uma JOptionPane
Segue o código:
private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {
jTable1 table = (jTable1) evt.getSource();
int row = table.rowAtPoint(evt.getPoint());
int col = table.rowAtPoint(evt.getPoint());
if(table.getValueAt(row,col) != null){
JOptionPane.showMessageDialog(this, "Valor: "+table.getValueAt(row, col));
}
}
package Tabelas;
import java.awt.Point;
class jTable1 {
int rowAtPoint(Point point) {
throw new UnsupportedOperationException("Not yet implemented");
}
Object getValueAt(int row, int col) {
throw new UnsupportedOperationException("Not yet implemented");
}
}