This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Well, Andrew's answer is the best answer. Making a PlainDocument that accepts only numbers and only up to a certain number of numbers, then PlainDocuments and extending JTextField is the way to go. Andrew posted a good tutorial, and if I was at my desk at work and not onsite at one of our regions, I'd post the simple code that you need. But I guess it is better this way because you can learn to use PlainDocuments on your own. Mark
Is it necessary to use text field to book the record? can't we use the editable column once user double clicks on the record to book it, and make only the owner column editable. is this bad idea?
Joined: Apr 09, 2003
Hi, Ganapathy, I think it is fine to use editable column. The question I raised is how to ensure the input is an 8-digit number. For example, "shan1111", "123456789" are incorrect and should be rejected. The progam can check it after user presses "book" button, or does not allow such input on fly. shan