Forgive my ignorance, I forget what the thread titles are when I'm working.
You want to restrict the textfield to only 3 chars right?
A possible solution would be to create a keyListener on the TextField and keep track of the textfield content. Do a check on keyPressed sort of like the following:
void keyPressed(keyEvent e) {
numberOfCharsInTextField++;
if (numberOfCharsInTextField > 3) {
numberOfCharsInTextField--;
textField.setText(oldText);
}
}
Or something like that.