title: How to call setVisible from another class?
body: <p><strong>What I have:</strong>
  Two Classes that instantiate two JFrames. </p>
  
  <p><strong>What I am trying to achieve:</strong> 
  One with a button and the other that will become invisible when a action is fired on the button.</p>
  
  <p><strong>Problems:</strong> 
  I do not know how to pursue this. How should I go about coding this?</p>
  
  <h2>Class 1</h2>
  
  <pre><code>public class test1{
      public static void main(String[] args){
          JFrame frame = new JFrame("Blinkly Frame"); 
  
          frame.setSize(100, 100); 
          frame.setVisible(true); 
      }
  }
  </code></pre>
  
  <h2>Class 2</h2>
  
  <pre><code>public class test2{
      public static void main(String[] args){
           JButton button = new JButton();
          //when i will click this button i want to make invisible frame
      }
  }
  </code></pre>