private void btnExtractItemActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnExtractItemActionPerformed
    {//GEN-HEADEREND:event_btnExtractItemActionPerformed
        JFileChooser fc = new JFileChooser();
        fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fc.setDialogTitle("Choose where to extract this item");
        String lastfile = Preferences.userRoot().get("lastFile", null);
        if (lastfile != null) fc.setSelectedFile(new File(new File(lastfile).getParentFile() + "/" + selectedPath.substring(selectedPath.lastIndexOf("/") + 1)));
        if (fc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION)
            return;
        
        File selfile = fc.getSelectedFile();
        if (selfile.exists())
        {
            if (JOptionPane.showConfirmDialog(this, "There is already an item with this name. Overwrite it?", "WiiExplorer", JOptionPane.YES_NO_OPTION)
                    != JOptionPane.YES_OPTION)
                return;
        }
        
        try
        {
            if (archive.fileExists(selectedPath))
            {
                FileBase srcfile = archive.openFile(selectedPath);
                FileBase dstfile = new ExternalFile(selfile.getPath(), "rw");
                
                dstfile.setLength(srcfile.getLength());
                dstfile.setContents(srcfile.getContents());
                
                dstfile.save();
                dstfile.close();
                srcfile.close();
                lblStatusLabel.setText("File extracted successfully.");
            }
            else
            {
                extractDirectory(selectedPath, selfile.getPath());
                lblStatusLabel.setText("Directory extracted successfully.");
            }
        }
        catch (IOException ex)
        {
            lblStatusLabel.setText("Extraction failed: "+ex.getMessage());
        }
    }//GEN-LAST:event_btnExtractItemActionPerformed