Liesel's Compulator toy:


Compulator is an on screen "calculator" except it works more like you do things when you are programming a computer. That is mostly your numbers have to be in registers or memory before you carry out the math operation. Compulator has only very basic functionality; in fact it only does integer math on unsigned input of four digits maximum. Again this is intended as a piece of Java code for you to "play with" rather than being useful as a calculator. I notice many Java programmers are in the habit of putting all their code for a given applet in a single large class. I’ve never liked this style in other languages, but I thought I would try it anyway. As you’ll see Compulator’s functionality is contained within a single class file. As it turns out I think this will be the last time I use this style for Java. I like the modular approach such as I used with Spot Clock much better. In this Applet I kept with using only light weight swing components. Spot Clock was a little nasty in that I have a heavy weight Canvas class in with light weight classes. Sun’s tutorial warns against doing that sort of thing, but I mostly got away with it in Spot Clock. I think that I will do some sort of graphic toy next so I can learn how to do 2D graphics in light weight containers.

Compulator Class

Try Compulator





Back to main: Java Toys

Copyright © by Liesel Siobhan

The links at the bottom of your screen will take you to the main topic areas