Once you break down the concept of a text input box, you'll find it's not that much work to implement a basic one. Essentially you'll need to create a class that implements KeyListener and contains a Rectangle, a Point, and a String. Your key listener should check to see what key is being pressed and act appropriately. In the case of a backspace, you'll want to trim a character off of the end of your classes stored String value (assuming the String isn't already empty), in the case of an actual character, you'll want to append the value to the end of your String. If you need to limit which keys are processed by the event handler, use the events KeyCode value to see if the key is one you want to handle (here's an ASCII code reference chart
). When it comes time to render your text control, draw your rectangle at the location stored in your Point variable, then draw the string over top of it using whatever methods your graphics library provides. If you want to avoid the text appearing outside of the control, use the Rectangles data to set a clipping bounds.
Of course the above is just a rough outline. At some point you'll need to figure out how you want to handle things like text alignment, line wrapping, caret implementation, and other items to make it polished. If you're going to have more than one or two controls you'll probably want to look into implementing a control stack/manager at some point as well, but you should be able to get away without one for the time being.