public void newFrame() {
        int i = JOptionPane.showOptionDialog(this,
                "What kind of page would you like to add?",
                "New Page",
                JOptionPane.YES_NO_CANCEL_OPTION,
                JOptionPane.QUESTION_MESSAGE,
                null,
                new String[]{"Blank Page", "Page Copy", "Cancel"},
                "Blank Page");

        switch (i) {
            case JOptionPane.NO_OPTION:
                centerPanel.remove(layeredPanelList.getSelected());
                animationPane.updateAnimation(layeredPanelList, layeredPanelList.getIntSelectedPanel()+1);

                //Code to add previous image as background of new page
                BufferedImage bi = layeredPanel.paneToBufferedImg();
                layeredPanel = new LayeredPanel();
                layeredPanel.setBackground(bi);

                layeredPanel.addMouseListener(myListener);
                layeredPanel.addMouseMotionListener(myListener);
                this.setCurrentCanvasListener(layeredPanel);
                layeredPanel.setPreferredSize(new Dimension(width - 450, height - 300));
                layeredPanelList.add(layeredPanel);
                animationPane.updateAnimation(layeredPanelList, layeredPanelList.getIntSelectedPanel() + 1);
                refreshDrawPanel(layeredPanelList.getSelected());
                toolPanel.resetState();
                break;
            case JOptionPane.YES_OPTION:
                centerPanel.remove(layeredPanelList.getSelected());
                animationPane.updateAnimation(layeredPanelList, layeredPanelList.getIntSelectedPanel()+1);

                layeredPanel = new LayeredPanel();

                layeredPanel.addMouseListener(myListener);
                layeredPanel.addMouseMotionListener(myListener);
                this.setCurrentCanvasListener(layeredPanel);
                layeredPanel.setPreferredSize(new Dimension(width - 450, height - 300));
                layeredPanelList.add(layeredPanel);
                animationPane.updateAnimation(layeredPanelList, layeredPanelList.getIntSelectedPanel() + 1);
                refreshDrawPanel(layeredPanelList.getSelected());
                toolPanel.resetState();
            default :
                break;
        }
        layeredPanelList.getSelected().clearRootPane();
    }