title: setting Visibility of jButton of one class from another
body: <p>I have a main class which contains some panel and some buttons, and there is one other class through which I want to set visibility of buttons in main class.</p>
  
  <p>I have added one function to set visibility in main class
  like:</p>
  
  <pre><code>// This is my main class  
  public void setVisibility(boolean flag)  
  {   
      mybutton.setVisible(flag);  
  }
  
  // this is class which calls the method,
  my_constructor.setVisibility(false);
  </code></pre>
  
  <p>but this is not working, can anybody help?</p>