protected void update ( DocumentEvent event ) { String text ; try { text = event . getDocument ( ) . getText ( event . getDocument ( ) . getStartPosition ( ) . getOffset ( ) , event . getDocument ( ) . getEndPosition ( ) . getOffset ( ) - 1 ) ; model . setObject ( text ) ; } catch ( BadLocationException e1 ) { log . log ( Level . SEVERE , "some portion of the given range was not a valid part of the document. " + "The location in the exception is the first bad position encountered." , e1 ) ; } }
Update the underlying model object .