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

Posted on 2013-07-01
Medium Priority
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 1000 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.
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

771 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