₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,159 members, 8,448,908 topics. Date: Tuesday, 21 July 2026 at 04:46 AM

Toggle theme

Sleeping Computer In Java - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingSleeping Computer In Java (1891 Views)

1 Reply

Sleeping Computer In Java by koderNeptune(op): 6:16am On Jun 12, 2013
I want to ask if it is possible to make my computer sleep and wake up in java. I'm not talking about multi threading. Please if it is, kindly explain or send the code to me. Thanks
Re: Sleeping Computer In Java by sarutobi: 3:12pm On Jun 14, 2013
You have to call a command from java directly to the operating system. Since java is multi platform, this code might not work for some os.

Using java.lang exec method:

Runtime.getRuntime().exec("rundll32.exe powrprof.dll,SetSuspendState 0,1,0"wink;
System.exit(0);


this should work on windows32.
Re: Sleeping Computer In Java by koderNeptune(op): 6:59am On Jun 15, 2013
Thanks man. But kindly check, Programming for the blind link. I want the software to sleep the system after instructing the user that he/she can not read more than 1hr
1 Reply

Problem With Bufferedinputstream Read Blocking Issue In JavaI Want To Develop A Software In Java To Calculate CGPAHow Do Io Create Ribbon Ui In Java234

Creating A Simple CRUD Website With The Simple ASP.NET Webpages Model12 Simple Steps To Become A Certified HackerHere’s How AI Will Dominate A Web Developer’s Life In 2020