Hi all, I have a Jtable with 6 columns where i have Check boxes in the 6th Column.I am outing the text in to JTable by using the setValueAt() and getValueAt() methods.For the same Jtable I have Find,Replace and Replace All Controls to find,replace and replace all the text i the jtable.The Particular cel will be focussed for Find text.Particular cell will be focused and Replace the text with given text.
My problem is, at the time of replacing text with given text,im focusing the particular cell and using setValueAt() to replace.But the Check boxes in the 6th column are disturbed and Text is appearing in that column like YES or NO(For selected check box i used YES and Deselected checkbox i used NO strings). Here is my sample code:``
StringTokenizer st1 = new StringTokenizer(trstring1, "\t");//trstring1 is the Jtable string
for (i = 0; st1.hasMoreTokens(); i++) {
for (j = 1; j < 6; j++) {
rowstring = st1.nextToken();
if (rowstring.contains(findTxt)) {
rowstring = rowstring.replace(findTxt, replaceTxt);
str = trstring1.replaceFirst(findTxt, replaceTxt);
mProcessQuestionTestItemTable.setCellSelectionEnabled(true);
mProcessQuestionTestItemTable.changeSelection(i, j, false, false);
mProcessQuestionTestItemTable.requestFocus();
System.out.println("I:" + i);
System.out.println("J:" + j);
mProcessQuestionTestItemTable.setValueAt(rowstring, i, j);
}
}`