IndexFrame.java


import java.awt.*;
import java.awt.event.*;

public class IndexFrame 
    extends Frame implements MouseListener {
    Label labelList[];
    public IndexFrame(CachedDatabase cd) {
    	setLayout(new GridLayout(0,3));
    	labelList=new Label[cd.getSize()];
    	for (int i=0; i < cd.getSize(); 
    	    	i++) {
    	    AddressRecord a =cd.get(i);
    	    labelList[i]=new Label(a.getName());
    	    add(labelList[i]);
    	    labelList[i].addMouseListener(this);
    	}
    	setSize(400,400);
    }
     public void mouseClicked(MouseEvent e) {
         System.out.println(e);
     }

    /**
     * Invoked when a mouse button has been pressed on a component.
     */
    public void mousePressed(MouseEvent e) {}

    /**
     * Invoked when a mouse button has been released on a component.
     */
    public void mouseReleased(MouseEvent e) {}

    /**
     * Invoked when the mouse enters a component.
     */
    public void mouseEntered(MouseEvent e) {}

    /**
     * Invoked when the mouse exits a component.
     */
    public void mouseExited(MouseEvent e) {}

}

[Back to Index]
This document was generated automatically by Kahindu.
Kahindu