To get this functionality from the Java Side you would need to send the correspondent Script Code via one of the Client Interfaces (30001/2/3) to the robot from within the URCap.
See this answer for reference: Setting Digital input to freedrive through java - #3 by jbm