[Previous slide] [Next slide] Java and Database Connectivity

A bit about syntax: example java source

package uk.co.weft.clock;

import java.lang.*;     // import general utility classes
import java.awt.*;      // for graphics handling

/** A subclass of Hand which is just a blob rotating at a fixed
 *  length about the centre. All the mechanism for moving the 
 *  hand is in Hand.
 *
 *  @author Simon Brooke (simon@jasmine.org.uk)
 *  @version $Revision: 1.9 $
 */

public class BlobHand extends Hand
{
    int radius;         // the radius of my blob

    /** initialise myself; in addition to the things hands have
     *  generically, I have a radius */
    public BlobHand( int l, HandDriver d, int r)
    {
    super( l, d);

    radius = r;
    }

    /** just a blob round my end position */
    public void paint( Graphics g)
    {
        g.setColor( colour);

        g.fillOval( end.x - radius, end.y - radius, 
            2 * radius, 2 * radius);
    }
}

 


give me feedback on this page // show previous feedback on this page