Reputation: 41
I need to make sure the user can not type more than two string words into this text box and only use one space bar but not really sure how to write this code. I have everything else working fine!
Upvotes: 1
Views: 47
Reputation: 42174
Sounds like a job for an InputVerifier: http://docs.oracle.com/javase/7/docs/api/javax/swing/InputVerifier.html
Upvotes: 2