Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am developing a Java Swing Application.

The application ends with a form to take the customer's input information (name, last name, email, gender, etc)

I am trying to validate the text fields in a way that when the application is launched focus will go on the first text box (first name). I want the user to not be able to leave the box until they have entered a valid name (no numbers, punctuation and so on).

Unfortunately even after looking online, I am not able to find a solution to validating these boxes.

Action Plan:

Focus on first textfield >>> Unable to leave unless valid input is entered >> messages outputted to user >> validation completed >> focus set on next field >> and so on.

Help would be appreciated.

What I have tried:

i have tried focus lost listener to deal with it but could't succeed.
Posted
Updated 23-Jul-17 22:09pm

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900