private void scrollToOffset(int offset){
  try {
    Rectangle rect=modelToView(offset);
    scrollRectToVisible(rect);
  }
 catch (  BadLocationException ex) {
    LOGGER.warning("Bad Location");
  }
}

private void scrollToOffset ( int offset ) { try { Rectangle rect = modelToView ( offset ) ; scrollRectToVisible ( rect ) ; } catch ( BadLocationException ex ) { LOGGER . warning ( "Bad Location" ) ; } }
scrolls to the given offset in the document .
