Editing Source Files

Using Cosmo Code's Editor:

  1. Display a file in the Source panel in one of two ways:

  2. Edit the file using the edit commands on the Source, Edit, Find, and Custom menus, or their keyboard alternatives.

    If you are editing .java files containing code generated by the visual builder, do not modify the following code blocks:

    //{{ import_classes - Begin Non-Editable Code Block
    //}} import_classes - End Non-Editable Code Block
    
    //{{ init_applet - Begin Non-Editable Code Block
    //}} init_applet - End Non-Editable Code Block
    
    //{{ init_objects - Begin Non-Editable Code Block
    //}} init_objects - End Non-Editable Code Block
    
    //{{ wiring - Begin Non-Editable Code Block
    //}} wiring - End Non-Editable Code Block
    
    //{{ declarations - Begin Non-Editable Code Block
    //}} declarations - End Non-Editable Code Block
    
    //{{ init_size - Begin Non-Editable Code Block
    //}} init_size - End Non-Editable Code Block
    
    //{{ init_menubar - Begin Non-Editable Code Block
    //}} init_menubar - End Non-Editable Code Block
    

    Each time you save the interface through the visual builder, Cosmo Code overwrites these code blocks.

    Also, for user-defined methods used as event handlers in objects (created in the visual builder), Cosmo Code adds the comments:

    //{{ event_handler
    //{{ event_handler
    

    These comments must not be removed. Also the argument list to these methods appears as (Event event) and must not be altered.

  3. If you are writing your own methods to handle events in AWT objects, be sure to read Handling Events With User-Defined Methods.

  4. Choose File > Save to save your changes.

  5. Click the Run button to automatically recompile and run your program.

See Also

Guide to the Cosmo Code Development Environment
12-96*256