private void btnNewFolderActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnNewFolderActionPerformed
    {//GEN-HEADEREND:event_btnNewFolderActionPerformed
        String thename = JOptionPane.showInputDialog(this, "Enter the name of the new folder:", "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;
        }
        
        String pathtoaddin = selectedPath;
        if (pathtoaddin.isEmpty())
            pathtoaddin = archive.getRoot();
        else if (archive.fileExists(pathtoaddin)) 
            pathtoaddin = pathtoaddin.substring(pathtoaddin.lastIndexOf("/") + 1);
        String fullpath = pathtoaddin + "/" + thename;
        
        FileTreeNode pnode = treeNodes.get(pathtoaddin);
        FileTreeNode newnode = new FileTreeNode(archive, fullpath);
        int c;
        for (c = 0; c < pnode.getChildCount(); c++)
        {
            String thispath = (String)((FileTreeNode)pnode.getChildAt(c)).toString();
            if (thispath.compareTo(thename) >= 0) break;
        }

        pnode.insert(newnode, c);
        treeNodes.put(fullpath, newnode);
        
        DefaultTreeModel listmodel = (DefaultTreeModel)tvFileView.getModel();
        listmodel.nodesWereInserted(pnode, new int[] {c});
        
        archive.createDirectory(pathtoaddin, thename);
        trySave();
    }//GEN-LAST:event_btnNewFolderActionPerformed