JAVASKETCHPAD® AN INTRODUCTION
|
|||||
A copy of the JavaSketchpad® (JSP) files can be freely downloaded from the site
http://www.dynamicgeometry.com/javasketchpad/about.php Your download will give you a folder named jsp containing various working files that dont need to be touched. It does contain a 25 page file named JavaSketchpad Grammar.pdf. This file contains the syntax for the program and is worth printing off for future reference. I did my construction with Adobe GoLive® but any program which produces web pages will do. Open this file, and look at the Source view. You should see something like this (below right). Under Source Preferences, you should be able to adjust the font size here to a size you are comfortable working with, and probably add some colour coding to the text. None of this formatting code is of interest to us. We shall be inserting material in the space **.
With luck, your web page program will have a browser icon (say, Internet Explorer), which you can click at any time, thus revealing the progress you have made in your construction (or a message that you have made an error). I do have to say that the Java error messages are not always helpful! I like to work with two suitably sized windows open side by side: the code window at left and the browser demonstration window at right. Above left is the figure generated by a small sample program (below left) which illustrates the simple logical progression of the program commands. This is the material placed at ** . We have included a running commentary on the right. Of course, any programming language has its own syntax which will gradually become familiar with practice. However, we can make some general observations. Spaces between characters or between lines are not important, except in the case of commands containing several words.
We see that the structure and logic of JSP is really quite simple. On the other hand, JSP, like any other computer program, is completely unforgiving: the code has to be exactly right! If you try to run a program with a simple construction error (like a wrong bracket), JSP will give a helpful message. On the other hand, it is very easy to include an incorrect Object Reference #, and this will lead to a more mystifying prompt. If you have downloaded JSP, I encourage you to copy and paste the above program in the appropriate place on an .html page contained in the jsp folder. If it runs successfully, try modifying your program: change the colours, move the points, add objects of your own. In this last case, be careful of your Object Reference numbers. Enjoy your programming! |
|||||
|