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

Posted on 2013-07-01
Last Modified: 2013-07-01
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.
Question by:searchsanjaysharma
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 16

Accepted Solution

krakatoa earned 500 total points
ID: 39289720

Author Closing Comment

ID: 39289956
LVL 16

Expert Comment

ID: 39290034
THERE IS a way to lock screen, if it's Windows.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 16

Expert Comment

ID: 39290042
LVL 16

Expert Comment

ID: 39290096


"Is there any method in java . . . " - was my point.
LVL 16

Expert Comment

ID: 39290155
Runtime r = Runtime.getRuntime();
Process p = r.exec("rundll32.exe user32.dll, LockWorkStation");
BufferedReader b = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";

while ((line = b.readLine()) != null) {
LVL 16

Expert Comment

ID: 39290574
searchsanjaysharma : If you want to change to Valeri's workaround, then feel free to call Mod and get the points re-allocated.

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question