Hi,
 
I want to update the JScrollPane in another thread, like this:
------------------------------------------
  public void newMessage(ChargedCdr ccdr) {  // will be invoked in a non-event-dispatching thread
    ...
    model.fireTableDataChanged();        //of a table within jScrollPane1
    jScrollPane1.getVerticalScrollBar().setValue(jScrollPane1.getVerticalScrollBar().getMaximum());
  }
------------------------------------------
The function I wanna get is to move the scroll bar to the end of the table whenever model's data changed(by another thread), and it could work, but some times just not to the end of the table, but still has 1 line left below.
 
Maybe I misused the setValue, because it was not in a event-dispatching thread, am I right?
 
Then what is the right way to do this?
 
regards,
Yuan Bing
 

Reply via email to