title: Enable/Disable button of a form from another class
body: <p>Hello my problem is: I am not able to enable a button of a form, from another class. My form class is </p>
  
  <pre><code>public class FileSending {
     //Function for enabling the button 
     public void activate_btnSEND (boolean flag) {
         SendFile.setEnabled(flag);      
     }    
  }
  </code></pre>
  
  <p>And the class from where i am calling this function is as follows : </p>
  
  <pre><code>public class SMS {
     Public void split(){
        if(check_string.equalsIgnoreCase("0001"))  {                
             JOptionPane.showMessageDialog(null, " Recepient Has Accepted The" +
                                  " Request.Connection Has Been Established :) ");  
             FileSending setBtn = new FileSending();
             setBtn.activate_btnSEND(true);               
        }
     }
  }
  </code></pre>
  
  <p>I debugged the code to check the value that is being passed to flag and the value is <em>"True"</em>. It also goes inside the if condition but the Button is not enabled. I don't understand what is happening here !! </p>