public NBTEdit(final JTree tree, final NBTFrame frame) {
    setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    name = new JLabel(" ");
    text = new JTextField();
    cur = null;
    add(name);
    add(text);
    final Action action = new AbstractAction("Edit") {

      private static final long serialVersionUID = -5082168158857360395L;

      @Override
      public void actionPerformed(final ActionEvent e) {
        edit(tree, frame);
      }

    };
    add(new JButton(action));
    text.addKeyListener(new KeyAdapter() {

      @Override
      public void keyReleased(final KeyEvent e) {
        if(e.getKeyCode() == KeyEvent.VK_ENTER) {
          action.actionPerformed(null);
        }
      }

    });
    add(new JButton(new AbstractAction("Open") {

      private static final long serialVersionUID = 4663994095611490449L;

      @Override
      public void actionPerformed(final ActionEvent ae) {
        final JFileChooser fc = new JFileChooser();
        if(LAST.exists()) {
          try {
            final Scanner s = new Scanner(LAST);
            final File last = new File(s.nextLine());
            fc.setSelectedFile(last);
          } catch(final IOException e) {
            e.printStackTrace();
          }
        }
        final int returnVal = fc.showOpenDialog(NBTEdit.this.getParent());
        if(returnVal != JFileChooser.APPROVE_OPTION) return;
        setFile(fc.getSelectedFile(), tree, frame);
      }

    }));
    add(new JButton(new AbstractAction("Save") {

      private static final long serialVersionUID = -7308700550861060140L;

      @Override
      public void actionPerformed(final ActionEvent ae) {
        final File file = getFile();
        if(file == null || !canSave()) return;
        final NBTRecord r = (NBTRecord) tree.getModel().getRoot();
        if(!r.hasChanged()) return;
        try {
          final NBTWriter write = new NBTWriter(file, wrapZip());
          write.write(r);
          write.close();
        } catch(final IOException e) {
          e.printStackTrace();
        }
        r.resetChange();
        tree.getModel().valueForPathChanged(new TreePath(r), r);
        frame.setTitle(file, r.hasChanged());
      }

    }));
    tree.getSelectionModel().setSelectionMode(
        TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.addTreeSelectionListener(new TreeSelectionListener() {

      @Override
      public void valueChanged(final TreeSelectionEvent e) {
        setPath(e.getPath());
      }

    });
  }