Mac Java Journal

Week Four

3/9/96 When you create an applet, e.g. with the Animator.class, and view it, the Applet Viewer automatically reduces its window to fit the image your are using. But when you put the applet on your server and it is accessed by a browser, it makes a grey area the size of your parameters. For example <applet code=Macjava.class width=100 height=100> creates an area 100 by 100, but if your image is actually 60 by 70 then it sits in that larger area. Looks ugly and takes up unneccessary room. Vice versa, if you set your width and height parameters too small it will cut off your image on the Web page. It also appears that if you have a frame that is too small for your image, you don't see even a part of it on the Web page.

3/14/96 Now that things have settled down again, I'm back to the Campione-Walrath tutorial. Checking out the module called Writing Java Programs. I scan through since I've been here before. In the subsection called Nuts and Bolts of the Java language. I find that they are dealing with applications rather than applets. So I followed their explanation of the components with the caution that I can't run this on the MacJDK, because it only handles applets.

I just realized that I have gone a month without making a coffee-related joke or used the coffee metaphor for Java. Therefore I am declaring this a Caffeine-Free zone. Wait! Is that a coffee joke? Damn, I blew it.

3/15/96 I haven't had the time or patience to attack Java in as organized manner as I might wish, and I still feel there is a wall of abstraction between me and the language. The Campione-Walrath tutorial is excellent and in depth, but I am going out looking for some more tutorial material. I am looking for something that show me how to do one thing that I can apply to lots of different variations. If I can just get a hook into this Javafish, I think I can land him. I just hope the game warden doesn't catch me programming without a license.

Where to look? Well, Gamelan of course. It's the Mother of all Java sites. (Looking.) Eureka! I've found a little entry at http://www.gamelan.com/frame/Gamelan.programming.learningjava.html that says


    Ê 
            Java labÊ (Document) Ê
Java programming tutorial-from "Helloworld" to TickerTape in seven steps 

Author: Timothy Arnold 
Entered: 11-Oct-95

This looks promising (and it is. I've already looked at it and now I'm back at this journal pretending to be writing in the present tense. Hey, I do have a license after all, a poetic license.) I found Timothy's explanations of the Java scripting to be excellent. I recommend you go through this set of pages. The only problem is that when I copied the code for each of the 7 different versions of HelloWorld, not one of them would run successfully on the Applet Viewer. But, and I found this highly irritating, when I uploaded them to my server and accessed them with Netscape on Win95 they performed just fine. So we cannot trust the Applet Viewer. That pretty much screws up the ability to develop applets with the MacJDK on a 68k Mac.

Here's the applet:
Or maybe not.

Some things that Timothy pointed out were that you can move the image around within the background with the x, y coordinates. He had an excellent description of threads, implements and suspend().
I also noticed that you can define variable in your code or you can define them in the html as params. The more you leave for your html code to set, the more flexible and reusable the applet will be.

3/16/96 Company voted most into the Coffee Metaphor would have to be Symantec who has brought out Expresso and Caffeine and promises Cafe in the near future. Wow, these development environments definitely look attractive after spending all this time putzing around with the MacJDK (beta).

Back to MacJava