Simple editor in Java