compile when I get the message ' setLocked ' was not Declared In This scope

... and setLocked(true) should be terminated with a semi-colon ';'
and the '{' following setLocked(true) should be replaced with a '}'