title: Detect when computer goes into sleep mode
body: <p>Is it possible in Java to detect when the computer goes into sleep mode? I've already tried to count seconds with <code>Thread.sleep(1000)</code> but it seems as if it would continue counting in sleep mode.</p>