FileDocCategorySizeDatePackage
SimpleClick.javaAPI DocExample1421Tue Dec 12 18:57:26 GMT 2000None

SimpleClick

public class SimpleClick extends Applet implements MouseListener

Fields Summary
StringBuffer
buffer
Constructors Summary
Methods Summary
voidaddItem(java.lang.String newWord)

        System.out.println(newWord);
        buffer.append(newWord);
        repaint();
    
public voiddestroy()

        addItem("preparing for unloading...");
    
public voidinit()

	addMouseListener(this);
	buffer = new StringBuffer();
        addItem("initializing... ");
    
public voidmouseClicked(java.awt.event.MouseEvent event)

	addItem("click!... ");
    
public voidmouseEntered(java.awt.event.MouseEvent event)

    
public voidmouseExited(java.awt.event.MouseEvent event)

    
public voidmousePressed(java.awt.event.MouseEvent event)

    
public voidmouseReleased(java.awt.event.MouseEvent event)

    
public voidpaint(java.awt.Graphics g)

	//Draw a Rectangle around the applet's display area.
        g.drawRect(0, 0, 
		   getSize().width - 1,
		   getSize().height - 1);

	//Draw the current string inside the rectangle.
        g.drawString(buffer.toString(), 5, 15);
    
public voidstart()

        addItem("starting... ");
    
public voidstop()

        addItem("stopping... ");