private void btnDeleteItemActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnDeleteItemActionPerformed
    {//GEN-HEADEREND:event_btnDeleteItemActionPerformed
        if (JOptionPane.showConfirmDialog(this, "Really delete this item?", "WiiExplorer", JOptionPane.YES_NO_OPTION)
                != JOptionPane.YES_OPTION)
            return;
        
        if (archive.fileExists(selectedPath))
            archive.deleteFile(selectedPath);
        else
            archive.deleteDirectory(selectedPath);
        
        FileTreeNode tn = treeNodes.get(selectedPath);
        int rindex = tn.getParent().getIndex(tn);
        treeNodes.remove(selectedPath);
        
        List<String> toremove = new ArrayList<>();
        for (String k : treeNodes.keySet())
        {
            if (k.startsWith(selectedPath))
                toremove.add(k);
        }
        
        for (String k : toremove)
            treeNodes.remove(k);
        
        DefaultTreeModel listmodel = (DefaultTreeModel)tvFileView.getModel();
        listmodel.nodesWereRemoved(tn.getParent(), new int[] {rindex}, null);
        
        trySave();
    }//GEN-LAST:event_btnDeleteItemActionPerformed