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);

[2222 byte] By [JoHaa] at [2007-11-26 21:02:01]
# 1

try to do this:

model.fireTableDataChanged();

after

table.changeSelection(10, 0, false, false);

did you see the documentation : http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JTable.html#changeSelection(int,%20int,%20boolean,%20boolean)?

java_2006a at 2007-7-10 2:34:04 > top of Java-index,Java Essentials,New To Java...
# 2
No, still, nothing happens...
JoHaa at 2007-7-10 2:34:04 > top of Java-index,Java Essentials,New To Java...