I need an advice or suggestion, I have a JTextField for a primary key entry and when the focus leaves the JTextField, the program would make a searching into a database to seek if this entry has already been inside the table. (aka checking double entries).
if the entry is found inside the table, a JOptionPane or JDialog will show up and alert the user that his / her entry code already existed.
I’ve tried to insert the validation searching (using SQL) block in JTextField’s FocusLost, sure the JOptionPane / JDialog appeared, but then no matter when the OK button (inside the JOptionPane / JDialog) was clicked. the JOptionPane / JDialog would still show up again and again.
do you have any idea about how to solve this problem? any advice? or better way to do this?
thank you so much for dropping by your message. 🙂