title: Java Netbeans Jlabel Hide and Show
body: <p>I have a Jframe form and once this form runs i would like some specfeic labels become invisble until the user press on the "Submit button" they become visible.</p>
  
  <p>Assuming that i have 2 JLabels named Label1 and Label2</p>
  
  <p>The idea in my mind would be to go for the constructor of the JFrame class and write </p>
  
  <pre><code>Label1.setVisible(false);
  Label2.setVisible(false);
  </code></pre>
  
  <p>Then at the <code>ActionPerformed</code> function of the Submit button</p>
  
  <pre><code>Label1.setVisible(true);
  Label2.setVisible(true);
  </code></pre>
  
  <p>But this option does not work and netbeans keeps showing several errors, the question is does my idea is not the proper way to do it or i'm just doing it wrong?</p>