Java, a simple alarm