Simple painting application in Java