// DisplayPanel.java

package lab08;

/**
 * The class that actually displays the BinaryTree in the center
 * of the appication window.
 * 
 * @author J.K. Daugherty
 */
public class DisplayPanel extends javax.swing.JPanel {

    private BinaryTree bintree;

    public DisplayPanel (BinaryTree bintree) {
        this.bintree = bintree;
        setBackground (new java.awt.Color (0xD4, 0xEC, 0xFB));
    }

    protected void paintComponent (java.awt.Graphics g) {
        super.paintComponent (g);
        bintree.render (g, getSize());
    }
}
 