I have a JTable
displaying the contents of a log file, and the first column is a timestamp with milliseconds (e.g. 10:31:54.531).
The data is already ordered by this column.
I would like to allow the user to scroll to the timestamp he is interested in.
Here is a Java snippet of what I would like to do:
String myTimestamp = "10:31:54.531";
Integer myRowIndex = getRowIndexFromStringTimestamp(myTimestamp);
myJTable.getSelectionModel().setSelectionInterval(myRowIndex, myRowIndex);
myJTable.scrollRectToVisible(new Rectangle(myJTable.getCellRect(myRowIndex, 0, true)));
But how to implement getRowIndexFromStringTimestamp
?
Thank you