public LABELTEST() {
        super("Image Labeler");
        initComponents();
        
        // This code sets the behavour when the application is closing
        this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
        this.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                 quit();
            }
        });

        setRedo(false);
        setUndo(false);



        imagePanel1.setLB(this);
        jToolBar1.setSize(100, 100);
        rootNode = new DefaultMutableTreeNode("Objects");
        treeModel = new MyTreeModel(rootNode);
        //DefaultMutableTreeNode category = new DefaultMutableTreeNode("Books for Java Programmers");
        //rootNode.add(category);



        imagePanel1.manager = new ObjectManager(this);


        jTree1.setModel(treeModel);
        jTree1.setCellRenderer(new MyRenderer(imagePanel1.manager));
        jTree1.addTreeSelectionListener(new MyTreeListener(imagePanel1.manager, jTree1, imagePanel1));
        jTree1.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

        final ActionListener menuListener = new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                PolygonObject po = imagePanel1.manager.getSelected();
                if (po != null) {
                    if ("Rename".equals(event.getActionCommand())) {
                        String name = null;
                        name = JOptionPane.showInputDialog("Enter object name:",po.getName());

                        if (name != null && !name.equals(po.getName())) {
                            po.setName(name);
                            setUnsavedChanges(true);
                        }
                        jTree1.updateUI();
                    }
                    if ("Delete".equals(event.getActionCommand())) {
                        imagePanel1.manager.deleteObject(po);
                        if (imagePanel1.manager.objects.size() == 0) {
                            imagePanel1.mode = ImagePanel.Mode.AddPoly;
                        }
                        setUnsavedChanges(true);
                    }
                }
            }
        };
        jTree1.addMouseListener(new MouseAdapter() {
            @Override
            public void mousePressed(MouseEvent e) {
                if (SwingUtilities.isRightMouseButton(e)) {
                    TreePath path = jTree1.getPathForLocation(e.getX(), e.getY());
                    jTree1.setSelectionPath(path);
                    Rectangle pathBounds = jTree1.getUI().getPathBounds(jTree1, path);
                    if (pathBounds != null && pathBounds.contains(e.getX(), e.getY())) {
                        JPopupMenu contextMenu = new JPopupMenu();
                        JMenuItem rename = new JMenuItem("Rename");
                        rename.addActionListener(menuListener);
                        contextMenu.add(rename);
                        JMenuItem delete = new JMenuItem("Delete");
                        delete.addActionListener(menuListener);
                        contextMenu.add(delete);
                        contextMenu.show(jTree1, pathBounds.x, pathBounds.y + pathBounds.height);
                    }
                }
            }
        });



        imagePanel1.manager.setWorkingTree(rootNode);
        imagePanel1.manager.jt = jTree1;

        imagePanel1.manager.model = treeModel;

        // Load in in image and label set
        //double scale = imagePanel1.loadImage(filepath);
        //XMLReader rd = new XMLReader(filepath + ".xml");
        //removeNodes();
        //rd.openXML(imagePanel1.manager, scale);
        setUnsavedChanges(false);
        //drawMode();

    }