title: How to make a text field visible if it is initially hidden during run time?
body: <p>The problem is that at run time textField is hidden. But when jButton1 is selected it still remains hidden. Here is the Code:</p>
  
  <pre><code>package test;
  
  import javax.swing.*;
  
  public class NewJFrame extends javax.swing.JFrame {
  
  
      public NewJFrame() {
          initComponents();
          jTextField1.setVisible(t);}
  
  static boolean t=false;
  
      private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
          // TODO add your handling code here:
          String qty=jTextField2.getText();
          int q=Integer.parseInt(qty);
          if(q!=0)
          jTextField1.setVisible(true);
      }    
      public static void main(String args[]) {
          java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                  new NewJFrame().setVisible(true);
              }
  </code></pre>