int count=table.getSelectedRow();//獲取你選中的行號(記錄)
String getname= table.getValueAt(count, 1).toString();//讀取你獲取行號的某一列的值(也就是字段)
這樣就可以達到效果。
int count=table.getSelectedRow();//獲取你選中的行號(記錄)
String getname= table.getValueAt(count, 1).toString();//讀取你獲取行號的某一列的值(也就是字段)
這樣就可以達到效果。
https://stackoverflow.com/questions/419163/what-does-if-name-main-do