in JOption pane I have some JTextArea where user must eneter some text. Then if user click OK code execute. But i want that code will not execute if input text is not enetered.
I am using mouse listener to check OK button but i do not know how to reopen JOption if input text is not enetered and let him go to next step if is text enetered.
my code:
case JOptionPane.YES_OPTION: {
String text= op.getText();
if (text.equals("")) {
// how to prevent closing joptionpane!
} else {
// my code
break;
}
}
1 Answer