private void btnRenameItemActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnRenameItemActionPerformed
    {//GEN-HEADEREND:event_btnRenameItemActionPerformed
        String thename = JOptionPane.showInputDialog(this, "Enter the new name for the item:", "WiiExplorer", JOptionPane.QUESTION_MESSAGE);
        if (thename == null || thename.trim().isEmpty()) return;
        if (thename.contains("/") || thename.contains("\\"))
        {
            JOptionPane.showMessageDialog(this, "Invalid name entered. It must not contain slashes.", "WiiExplorer", JOptionPane.ERROR_MESSAGE);
            return;
        }
        
        if (archive.fileExists(selectedPath))
            archive.renameFile(selectedPath, thename);
        else
            archive.renameDirectory(selectedPath, thename);
        
        FileTreeNode tn = treeNodes.get(selectedPath);
        treeNodes.remove(selectedPath);
        selectedPath = selectedPath.substring(0, selectedPath.lastIndexOf("/") + 1) + thename;
        tn.setUserObject(selectedPath);
        treeNodes.put(selectedPath, tn);
        
        DefaultTreeModel listmodel = (DefaultTreeModel)tvFileView.getModel();
        listmodel.nodeChanged(tn);
        
        setFileDescription(tn);
        trySave();
    }//GEN-LAST:event_btnRenameItemActionPerformed