String command = ""; ( click here for shutdown_command )
Process child = Runtime.getRuntime().exec(command);
Or may be try one of these ...
Try one of these (they've both worked, but there might be problems with one - too long ago, don't remember, though )
C:\WINDOWS\RUNDLL32.EXE SHELL32.DLL,SHExitWindowsEx 1