hi, i have problem with JOptionPane message, my application is a dictionary, if the user entered invalid word and clicked on search button, warnning message should be displayed. However, in my case the program stick without getting any message.this the code that i wrote:
//click on the search button
private void jButton1ActionP erformed(Action Event evt) {
String key = jTextField1.get Text();
boolean done = false;
while(!done){
try{
jTextArea3.setT ext(opr.getCode (key));
jTextArea1.setT ext(opr.getExp( key));
if(jTextField1. getText()!= key || jTextField1.get Text()== null)
done = true;
}
catch(Exception ex){
JOptionPane.sho wMessageDialog( null, "Invalid termonology was entered");
done = false;
}}}
//click on the search button
private void jButton1ActionP erformed(Action Event evt) {
String key = jTextField1.get Text();
boolean done = false;
while(!done){
try{
jTextArea3.setT ext(opr.getCode (key));
jTextArea1.setT ext(opr.getExp( key));
if(jTextField1. getText()!= key || jTextField1.get Text()== null)
done = true;
}
catch(Exception ex){
JOptionPane.sho wMessageDialog( null, "Invalid termonology was entered");
done = false;
}}}
Comment