// ----------------------------------------------------------
// DisplayPanel.java

package lab10;

import java.awt.*;

/**
 * The class that actually displays the Hashtable instance
 * in the center of the appication window.
 * @author J.K. Daugherty
 */
public class DisplayPanel extends javax.swing.JPanel {
    private Hashtable table;
    private Point loc;

/**
 * @param table The Hashtable instance to be rendered.
 * @param loc The location of the table in the panel.
 */
    public DisplayPanel (Hashtable table, Point loc) {
        this.table = table;
        this.loc = loc;
        setBackground (new Color (0xD4, 0xEC, 0xFB));
    }

/**
 * The method that renders the object.
 */
    protected void paintComponent (Graphics g) {
        super.paintComponent (g);
        table.render (g, getSize(), loc);
    }
}
 