Get user input with textbox class

Thank you for the reply. Would it be possible to put the keyReleased() function inside a class?