A simple text editor in Java