Is is possible to lock the computer unless the user enters the password.

I have created the Attendance Utility. Here in the module contains Short Break, Lunch break ,Day Attendance  etc etc.

Suppose the candidates goes for short breaks he needs to click on the button and the moment he click on the login screen will come and the screen should be locked.

When one enters the password the screen should be unlocked and so on.

Is there any method in java that can lock the screen.

Application is Windows Based using Swings.
searchsanjaysharmaAsked:
Who is Participating?
 
krakatoaConnect With a Mentor Commented:
No.
0
 
searchsanjaysharmaAuthor Commented:
Tx
0
 
ValeriCommented:
THERE IS a way to lock screen, if it's Windows.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
ValeriCommented:
0
 
krakatoaCommented:
>>Tx<<

;)

"Is there any method in java . . . " - was my point.
0
 
ValeriCommented:
Runtime r = Runtime.getRuntime();
Process p = r.exec("rundll32.exe user32.dll, LockWorkStation");
p.waitFor();
BufferedReader b = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";

while ((line = b.readLine()) != null) {
  System.out.println(line);
}
0
 
krakatoaCommented:
searchsanjaysharma : If you want to change to Valeri's workaround, then feel free to call Mod and get the points re-allocated.
0
All Courses

From novice to tech pro — start learning today.