Closing a Form

Next, you must free the memory used by the form. This is the last operation in the main functionmethodfunction of the program.

  1. The program's main method calls the API’s destroy method to delete the theForm object.
                theForm.destroy( );
             }
    
  2. Display any exceptions before terminating.
             catch (Exception ex)
             {
                ex.printStackTrace( );
             }
          }