Simple Text Editor in Java