Code example for Button

Methods: setEnabled

0
    disconnect(); 
  } 
   
  private void disconnect() { 
    service=null;
    btn.setEnabled(false);
  } 
} 
Contextual code suggestions in your IDE  Get Codota for Java