You can't put a Scanner in the drawing panel... and you can't use a Scanner to get keyboard input from a drawing panel. Your two choices are:
a) use a Scanner to get input from System.in, which means people will need to type their input into the console in Eclipse. It would probably be best to do this before opening/creating the DrawingPanel, since after the window is popped up, your users are unlikely to know that they need to go back to the console to type something.
b) You can get one keystroke at a time, using keyboard input methods (see the interactive graphics example posted to Moodle). This works well for dealing with individual keys being pressed (like choosing a,b,c,d for multiple choice, or checking to see which arrow key they pressed for controlling a game), but not very well for collecting whole words.
Hope that helps...