Simple text editor coded in Java