FileDocCategorySizeDatePackage
TouchWindow3.javaAPI DocExample1436Sun Dec 27 14:20:50 GMT 1998None

TouchWindow3

public class TouchWindow3 extends Applet implements MouseMotionListener

Fields Summary
int
xMouse
int
yMouse
int
xWindow
int
yWindow
Constructors Summary
Methods Summary
voiddrawTinkerToys(java.awt.Graphics g, int iNumSpokes)

        int i;
        Color c;

        for (i = 0; i < iNumSpokes; i++)
          {
          c = new Color
            (
            (int) (255 * Math.random ()),
            (int) (255 * Math.random ()),
            (int) (255 * Math.random ())
            );
          g.setColor (c);

          g.drawLine
            (
            (int) (xWindow * Math.random ()),
            (int) (yWindow * Math.random ()),
            (int) (xWindow * Math.random ()),
            (int) (yWindow * Math.random ())
            );
          }
        
public voidinit()

        addMouseMotionListener (this);
        
public voidmouseDragged(java.awt.event.MouseEvent evt)

        xMouse = evt.getX ();
        yMouse = evt.getY ();
        repaint ();
        
public voidmouseMoved(java.awt.event.MouseEvent evt)

        xMouse = evt.getX ();
        yMouse = evt.getY ();
        repaint ();
        
public voidpaint(java.awt.Graphics g)

        xWindow = getSize().width;
        yWindow = getSize().height;
        drawTinkerToys (g, 25);