title: if else statement not working properly
body: <p>this is my first time using this forum and I am new to the whole Java experience, so forgive me if this is a really simple fix.</p>
  
  <p>I am trying to make this project for school, but I can't get my if else statement to work.
  As you can see, if you enter melee or ranged everything is alright, but if you don't it redirects you.
  My problem is that even if you type melee or ranged, it will first direct you to the if method, and after that it will immediately redirect you to the else statement.</p>
  
  <p>Does anyone know how I can fix this?</p>
  
  <pre><code>newchamp.Type = JOptionPane.showInputDialog(null, "What type of champion have you summoned? (melee or ranged)", "Type", JOptionPane.PLAIN_MESSAGE);
          if (Type.equalsIgnoreCase("melee")) {
             JOptionPane.showMessageDialog(null,"You have now confirmed your champion, you can not edit anything from this point on.");
          }
          if (Type.equalsIgnoreCase("ranged")) {
                JOptionPane.showMessageDialog(null,"You have now confirmed your champion, you can not edit anything from this point on.");
          }
          else {
              JOptionPane.showMessageDialog(null,"You can only choose Melee or Ranged!");
              newchamp.Type = JOptionPane.showInputDialog(null, "What type of champion have you summoned? (Melee or Ranged)", "Type", JOptionPane.PLAIN_MESSAGE);
                 JOptionPane.showMessageDialog(null,"You have now confirmed your champion, you can not edit anything from this point on.");
  
          }
      }
  }
  </code></pre>