how can I create code that will lock the computer? I'm trying to create a software that can remotely lock/unlock a computer running on windows xp. Basically if I know how to create a method to lock/unlock the computer locally (that is keyboard is unusable and screen is blank/blue) then I will call that method remotely through RMI.
There's nothing in the standard Java API to do this. You will probably need to write some native code and call that via JNI, or if you have a small executable program which can do this you might be able to call it via Runtime.exec(...).