I have a problem with JTable Selection
I have a table which allows multiple selection it has only
ONE column with string values
I have 10 rows
I selected rows 2,5,7. And i saved these values
But when i again load the table
I am not able to make the selection of these row only the last row is selected
ie only 7th row
mycode is something like this
StringTokenizer rowsValue = // in this i get the values ie 2,5,7 row
jTableX1.clearS election();
while (rowsValue .hasMoreElement s()) {
String name = rowsValue.nextE lement().toStri ng().trim();
for (int i = 0; i < rowcount ; i++) {
String temp = jTableX1.getVal ueAt(i, 1).toString().t rim();
if (temp.equalsIgn oreCase(sensor) ) {
jTableX1.setRow SelectionInterv al(i,i);
}
}
Is this code correct can anyone help out
prakash
I have a table which allows multiple selection it has only
ONE column with string values
I have 10 rows
I selected rows 2,5,7. And i saved these values
But when i again load the table
I am not able to make the selection of these row only the last row is selected
ie only 7th row
mycode is something like this
StringTokenizer rowsValue = // in this i get the values ie 2,5,7 row
jTableX1.clearS election();
while (rowsValue .hasMoreElement s()) {
String name = rowsValue.nextE lement().toStri ng().trim();
for (int i = 0; i < rowcount ; i++) {
String temp = jTableX1.getVal ueAt(i, 1).toString().t rim();
if (temp.equalsIgn oreCase(sensor) ) {
jTableX1.setRow SelectionInterv al(i,i);
}
}
Is this code correct can anyone help out
prakash
Comment