You can solve this problem in the following steps:
1- Search the internet about .DLL files for locking and unlocking your windows Desktop.
2- .DLL files are written in C or C++ language.
3- You can invoke the .DLL file if and only if the java method from where you’re invoking is declared as native(Also search the internet for this)
4- You must use the concept of multithreading(Sleep Timer like things) on the internet.
5- Because a sleep timer in java let you lock your desktop after some seconds or minutes and you can unlock your keyword by typing correct username and password into the fields.
6- Also search the internet about username authentication code in java.
solved Java user control desktop application [closed]