This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes User Input into a Text Field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "User Input into a Text Field" Watch "User Input into a Text Field" New topic
Author

User Input into a Text Field

Dave Donohoe
Ranch Hand

Joined: May 16, 2000
Posts: 73
How do I restrict Users to only enter digits into a Text Field ?
I want to check before the User clicks OK.........
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
hi Dave,
IMO u will have to use consume() method of the AWTEvent class to consume the events of any key pressed/released that u want. once consumed the keys will not be shown in the text field/area.
Regds.
Rahul
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: User Input into a Text Field
 
It's not a secret anymore!