private void setUpFractalPanel()
    {
        fractalPanel = new FractalPanel();
        fractalPanel.setLayout(new OverlayLayout(fractalPanel));
        fractalPanel.setView(-5, 2, -2, 2);

        glassPane = new GlassPane();
        glassPane.setOpaque(false);
        glassPane.setBounds(fractalPanel.getBounds());

        MouseInputAdapter adapter = new MouseInputAdapter()
        {
            private Point dragBoxTopLeft;

            @Override
            public void mousePressed(MouseEvent e)
            {
                dragBoxTopLeft = e.getPoint();
            }

            @Override
            public void mouseDragged(MouseEvent e)
            {
                glassPane.getRect().setBounds(dragBoxTopLeft.x, dragBoxTopLeft.y, e.getX()
                    - dragBoxTopLeft.x, e.getY() - dragBoxTopLeft.y);
                glassPane.repaint();
            }

            @Override
            public void mouseReleased(MouseEvent e)
            {
                glassPane.getRect().setBounds(0, 0, 0, 0);
                Point dragBoxBottomRight = e.getPoint();

                //if a single "click" or if rectangle
                //area <= 4
                if(dragBoxBottomRight.equals(dragBoxTopLeft)
                    || (dragBoxBottomRight.x - dragBoxTopLeft.x)
                    * (dragBoxBottomRight.y * dragBoxTopLeft.y) <= 4)
                {
                    return;
                }
                double[] topLeftCorner = fractalPanel.pixelToCoord(dragBoxTopLeft.x, dragBoxTopLeft.y);
                double[] bottomRightCorner = fractalPanel.pixelToCoord(e.getX(), e.getY());
                views.push(fractalPanel.getView());
                fractalPanel.setView(
                    topLeftCorner[0], bottomRightCorner[0],
                    topLeftCorner[1], bottomRightCorner[1]);
                glassPane.repaint();
            }

            @Override
            public void mouseMoved(MouseEvent e)
            {
                //if alt is pressed, don't change cText
                if(e.isAltDown())
                {
                    return;
                }
                double[] cpx = fractalPanel.pixelToCoord(e.getX(), e.getY());
                cText.setText(new BigComplex(BigDecimal.valueOf(Double.valueOf(cpx[0])), BigDecimal.valueOf(Double.valueOf(cpx[1]))).toString());
            }

            @Override
            public void mouseClicked(MouseEvent e)
            {
                if(e.isShiftDown())
                {
                    if(e.isControlDown())//if ctrl-shift-leftclick
                    {
                        //zoom all the way out
                        views.clear();
                        fractalPanel.setView(-5.0, 2.0, -2.0, 2.0);
//                        dragBoxTopLeft.setLocation(0, 0);
                    }
                    else //if shift-leftclick
                    {
                        //zoom out to previous view
                        if(views.isEmpty())
                        {
                            return;
                        }
                        fractalPanel.setView(views.pop());
                    }
                }
                else //if leftclick only
                {
                    //zoom 2x on point of click
                    double[] oldView = fractalPanel.getView();
                    double[] targetCoords = fractalPanel.pixelToCoord(e.getX(), e.getY());
                    double newLeft = (oldView[0] + targetCoords[0]) / 2.0;
                    double newRight = (oldView[1] + targetCoords[0]) / 2.0;
                    double newTop = (oldView[2] + targetCoords[1]) / 2.0;
                    double newBottom = (oldView[3] + targetCoords[1]) / 2.0;
                    views.push(fractalPanel.getView());
                    fractalPanel.setView(newLeft, newRight, newTop, newBottom);
                }
                fractalPanel.repaint();
            }
        };
        addMouseListener(adapter);
        addMouseMotionListener(adapter);

        fractalPanel.add(glassPane);
        add(fractalPanel, BorderLayout.CENTER);
    }