I have a text field where I have imposed some constraint in input data, by the help of InputVerifier. The constraint is if the text field is left empty, then an error message will pop up. When the application starts, the cursor remains on the text field (text_field.requestFocusInWindow()).
Now, If the exit button is clicked, at anytime, The application should terminate immediately. But if the text field remains empty, it displays the error message and doesn't exit. How to solve this problem?
Exit Code:
dispose();
System.exit(0);