How do I enter into another form by clicking 5 buttons? : <p>I'm trying to write a code in Java. I've created a form where I have to type a code by clicking the buttons I've created. So, when I type btn1, btn2, btn3, btn4 and btn5 and then I click the 'Enter' button, it will lead me to the form i want. I've tried many different options but I just can't find a way to go through it. If somebody could help me, I'd be so thankful.
P.s I'm new at Java, so forgive me if i could'nt explain the thing properly.</p>

<pre><code> private void btnEnterStateChanged(javax.swing.event.ChangeEvent evt) {                                      
        // TODO add your handling code here:
       if(btn1.isSelected() &amp;&amp; btn2.isSelected()
    &amp;&amp; btn3.isSelected() &amp;&amp; btn4.isSelected() &amp;&amp; btn4.isSelected())
           {
                   LoginForm login = new LoginForm();
                   login.setVisible(true);
              }
else {
                    JOptionPane.showMessageDialog(this, 
                    "Wrong code!");
      }
    }
</code></pre>
