add in DocumentListener to the textfield to control the visibility of the ScrollBar