Compile an Applet in Cosmo Code

Change Project Settings Tutorial Contents View a Class Graph
  1. In the Cosmo Code main window, click the Build button above the Source panel.

    <PIC>


    This compiles the QuickMenu applet with the -g option so that symbol information is available during debugging, and builds the class database used for browing classes.

    Cosmo Code displays the Build card and prints compiler output in the top panel of the Build card. The compiler generates a 2 errors The first error is encountered on line 91 of the source file. The bottom panel of the Build card shows all the errors encountered during the compilation.

    <PIC>

  2. Click the Next Error button at the bottom of the Build card.

    The source code where the error was encountered (line 91) is displayed in the Source Panel. In this case the problem is that the Image class has not been declared. This is because the java.awt.* package has not been imported at the top of the QuickMenu.java file.

  3. On line 91, change "menustyles" to "menustyle to correct the typo.

  4. Click the Next Error button at the bottom of the Build card to display the next error in the source panel.

  5. On line 147, change "parserInt" to parseInt" to correct the method name.

  6. Choose File > Save to save the source file.

  7. Click the Build button to recompile the applet.

    This time, the applet should compile successfully, with the message "Build Succeeded" appearing in the compiler output panel. If you encounter problems, check the compile errors.

    Change Project Settings Tutorial Contents View a Class Graph

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