Audio Formats : This presentation shows narrated screenshots. It is available in
four different audio formats (
Ogg Vorbis ,
Flash ,
QuickTime , and
MP3 ). Also note that each of these formats have different
compression and quality settings for the audio, so you should not use this example as a comparison of
the audio quality but instead a comparison for the purpose of browser and platform support.
You are currently listening to the
Ogg Vorbis format.
Ogg Vorbis
Flash
QuickTime
MP3
The JavaScript code used to launch this exposition is:
new Scriptio({script:'cwmainme.txt', soundtrack:'cwmainme.ogg', width:592,
height:416, duration:79.61, background_color:'black', skin:'vanilla'})
script: cwmainme.txt
:set title to "Specifying the class with method main" :display "Specifying the class with method main" at {0,390} face serif color red size 14 fade 1 center true label "footer" :picture "toolbar.gif" at {1,1} size {567,21} label "cwwindow" :picture "cwwindow.gif" at {50,50} size {331,252} label "newproj" ~500 As you know, +2.7 :display "Execution begins: call method main of some class." at {55,250} size 13 style bold color red direction right wipe 3 label "exec" Java begins execution of an application by calling method <strong>main</strong>, which must appear in some class. Each class can contain a method <strong>main</strong>, +14.8 :display "Must tell CodeWarrior which class to use." at {55,267} direction right wipe 3 label "exec1" so CodeWarrior must be told which class contains the method <strong>main</strong> that is to be called when execution begins. In this activity, we describe how to do this.<br/> <nospeak> <b>When do you have to specify method <strong>main</strong>?</b><br/> </nospeak> You can tell there is a problem +26.1 :picture "error.gif" at {50,50} size {498,285} grow 2 label "error" :arrow at {219, 185} size {-18,-18} width 3 label "arr1" when execution results in a Java +28.5 :slide "arr1" to {95,165} duration 1 console that contains a message indicating that an +31.0 :slide "arr1" to {496, 165} duration 6 exception occurred in thread <strong>main</strong> --a class definition was not found. Here, it looks like class <strong>TrivialApplication</strong> was supposed to contain method <strong>main</strong>. <br/> ~100 +42.4 :pause with button ~100 +43.5 :clear "error" grow 1 :slide "arr1" to "cwwindow" by {250,90} duration 2 <nospeak> <b>Specifying the class</b><br/> </nospeak> To specify the class that contains method <strong>main</strong>, move your mouse to button <strong>Target</strong> +48 :recolor "arr1" to green <strong>Settings</strong> and click. The +48.5 :recolor "arr1" to red +49 :picture "target1.gif" at {2,35} size {614,375} label "target1" :layer "arr1" :slide "arr1" to {85,200} duration 3 <strong>Java</strong> <strong>Application Settings</strong> window that opens contains all sorts of things. On the left side of the +58.6 :recolor "arr1" to green window, click on <strong>Java</strong> <strong>Target</strong>, +59.2 :recolor "arr1" to red +60.6 :picture "target1c.gif" at "target1" size {614,376} label "target1c" :clear "target1" :layer "arr1" :slide "arr1" to {378,155} duration 3 and the right side of the window changes. Change field +68 :picture "target1d.gif" at {225,137} size {370,30} direction right wipe 1 label "target1d" :layer "arr1" :picture "save_button.gif" at {539,376} size {69,29} label "save_button" <strong>Main</strong> <strongClass</strong> to contain the name of the class that contains method <strong>main</strong>, +72.7 :slide "arr1" to "target1c" by {540,350} duration 1 :slide {"target1d", "target1", "target1c","save_button"} by {-30,0} duration 1 :layer "arr1" +73.7 -:picture "save_button" at {509,376} label "save_button" :layer "arr1" in this case, <strong>MyJLiveWindow</strong>. Then +74.3 :recolor "arr1" to green +74.9 :recolor "arr1" to red press button +75 :slide {"target1d", "target1", "target1c","save_button"} by {30,0} duration 1 :slide "arr1" to {16,44} duration 1 :layer "arr1" +76 :picture "pressed_buttons.gif" at "target1c" by {6,2} size {64,18} label "pb" :layer "arr1" +76.5 :recolor "arr1" to green +77 :recolor "arr1" to red +78 :clear {"target1c", "target1d", "pb", "save_button"} <strong>Save</strong> at the lower right of the window, and finally close the window. <br/> ~100 <nospeak> You can also get to the window for specifying class <strong>main</strong> by using menu Edit and item <strong>Java Applications Release Settings</strong>.</nospeak>