Stats: 3,190,158 members, 7,939,650 topics. Date: Wednesday, 04 September 2024 at 09:49 AM |
Nairaland Forum / Science/Technology / Programming / Sleeping Computer In Java (1821 Views)
Problem With Bufferedinputstream Read Blocking Issue In Java / I Want To Develop A Software In Java To Calculate CGPA / How Do Io Create Ribbon Ui In Java (2) (3) (4)
(1) (Reply)
Sleeping Computer In Java by koderNeptune(m): 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" ![]() System.exit(0); this should work on windows32. |
Re: Sleeping Computer In Java by koderNeptune(m): 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)
When Oyinbo Programmer Smoke Osogbo Weed For The First Time / Can Android Studio Run On 1gb Ram / Build Java FX Material Design App With Jfoenix
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 7 |