title: JOptionPane.showMessageDialog Why it is ERROR?
body: <pre><code>import javax.swing.JOptionPane;
  
  public class finals {
  
      public static void main(String[] args) {
  
          String text = "";
          boolean test = false;
  
  
          text = JOptionPane.showInputDialog("Input a or b: ");
  
          for(int i = 0; i&lt;text.length(); i++)
          {
              if(text.charAt(i) == 'a' || text.charAt(i) == 'b')
                  {
                      test = true;
                  } 
  
              else 
                  {
                      test = false;
                      break;
                  }
          }
  
          if(test == true) {
  
          text = text.replace("a", "o");
          text = text.replace("b", "1");
  
          JOptionPane.showMessageDialog(null,text, "Tan awa :)", JOptionPane.ERROR_MESSAGE);
  
          }
  
          if(test == false) {
  
  -----&gt;  JOptionPane.showMessageDialog(null, "DILI MAGPATAKA :)", JOptionPane.ERROR_MESSAGE); 
  
          }
      }
  
  }
  </code></pre>