Is there command to use on windows from java to make the computer sleep?
You can do it by executing a shell command, if you java app has enough rights to do so. The command is...
Runtime.getRuntime().exec("Rundll32.exe powrprof.dll,SetSuspendState Sleep");
That and other commands are shown here.