The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Hello. I have a program that takes a letter of the alphabet and translates it to a number on a telephone key pad. Everything is correct and prints out great in the console, but I need to do a GUI version of it, and I'm having massive trouble trying to figure out what the code is for the char user input.
I've tried to put in things like

but it's not working, and I have no other clue what it could be. The console version is below, I just need help with what I need to change the
"char userLetter =(QWERTY.next()).charAt(0);" to in order to get a GUI input box version. I know how to change the rest. Thanks in advance!