Problem with JTable and changeSelection method
Hi!
I can't get the changeSelection (int row, int col, boolean, boolean) to work. Actually, nothing happens when I call it. When i print the row and col count it clearly says, row = 100 and col = 1. Anybody know why changeSelection() doesnt work?
try{
JTable table =new JTable( model );
model.setRowCount(0);
Vector data =new Vector();
String aLine;
filename = listener.getFilename();
if (filename ==null)
thrownew IOException("No filename");
else{
LogFile f = FileManager.getInstance().openReadonly(filename);
for (int i =0 ; i <20 ; i++){
int myseqno = 0;
String xmpInfo =null;
f.positionAt(foundAtSeqno -10);
myseqno = f.read(b);
while (XMP.getBodyLen(b) == 0){
xmpInfo ="(extHdr) ";
myseqno = f.read(b);
}
Vector row =new Vector();
String s =new String(b, XMP.getBodyOffset(b), XMP.getBodyLen(b));
Object g =new StringCellValue(s, fakeObject);
row.addElement(g);
model.insertRow(i ,row);
model.fireTableDataChanged();
foundAtSeqno++;
//System.out.println("Rowcount" + table.getRowCount());
//System.out.println("Colcount" + table.getColumnCount());
}
System.out.println("Rowcount" + table.getRowCount());
table.changeSelection(10, 0, false,false);

