[JTable] savoir si une cellule est selectionnée
bonjour
je voudrais savoir si une cellule est selectionné dans une JTable. Exemple :
http://isash.free.fr/aide_forum/developpez/JTable.png
C'est la cellule (0;0) qui est selectionné...
J'ai testé avec :
Code:
1 2 3 4 5 6 7 8
| for(int c=0; c<jtable.getColumnCount();c++){
for(int r=0; r<jtable.getRowCount();r++){
if(jtable.isCellSelected(r,c)){
System.out.println("R:"+r+" C:"+c);
return true;
}
}
} |
mais ça ne marche pas ! :cry:
Comment faire ?
merci à vous ...
lipao