Here is my implementation of my custom lock screen.
First, make a app script with the following code. I placed this in app.gui.
lockScreen.visible = 1
lockScreen = system.nav.openWindow('Lock Screen')
Also, before calling this script, you need to run this script atleast once. I play this in my initial login script, just after opening my main menu bar. This sets a reference to the JFrame that the project is running inside of.
from javax.swing import SwingUtilities,JFrame
Application = SwingUtilities.getAncestorOfClass(JFrame, menu)
Finally, run this code to lock the screen. I have a menu option to lock the screen and also a Client Timer script that locks the screen after 15 minutes of inactivity