• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to restrict user from typing only english alphabet in java combobox  RSS feed

 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I am stuck with a problem and i want user can type only english alphabet in editable jcombobox. I know how to limit its length and ignore digits in it. But how can i limit user from typing special chars like @,# $%^^&*()!~~
Please help me..i will be highly thankful to you
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankush Seth wrote:Hello all,
I am stuck with a problem and i want user can type only english alphabet in editable jcombobox. I know how to limit its length and ignore digits in it. But how can i limit user from typing special chars like @,# $%^^&*()!~~
Please help me..i will be highly thankful to you


There are many ways. You know for sure is that the english alphabets are from A to Z. You could write a regex to match only characters between A and Z and if not then throw an error. I'm not sure if there is a Java Swing (assuming that you are using Java Swing) library that does this for you.
 
Ankush Seth
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thank you........very much ....actually my mind stopped working thats why i need your help! Thank you very much!
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!