Hm, some other crazy idea. You could write a KeyListener. If the user presses a digit, print it. If he presses another button, make a warning sound. If he presses return, read the number.
But this would be far more complicated, and as you are a Java novice, this isn't the best way to do it. In...