/** Handles the key press event. */ private void handleKeyPress(String key) { if (key.equals("enter")) { handleStartGame(); } else { passwordInputLabel.handleKeyPress(key); if (passwordInputLabel.wasTextChanged()) { String password = passwordInputLabel.getText(); if (password.length() > 0) { checkPassword(password); } } } }