private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        path = formatDest(jTextField3.getText().trim());
        if(path.length()>1 && item1!=null && item2!=null) {
            patch = loadFileChooser(new PatchChooseFilter(), true);
            try {
                if(patch!=null) {
                    if(!patch.getName().endsWith(".patch")) {
                        patch = new File(patch.getCanonicalPath() + ".patch");
                    }
                    UnifiedDiff uni = new UnifiedDiff(item1, item2);
                    patch = uni.createDiff(patch, path);
                    if(patch!=null) {
                        List<String> patchContents = fileToLines(patch);
                        if(patchContents!=null) {
                            patchContents.set(0, "--- .orig" + path);
                            patchContents.set(1, "+++ " + path);
                            patch = linesToFile(patchContents, patch);
                            if(patch!=null) {
                                category = ((String) jComboBox1.getSelectedItem()).toLowerCase()
                                        .replaceAll(" ", "_");
                                version = ((String) jComboBox2.getSelectedItem()).replace("webOS ", "");
                            } else {
                                JOptionPane.showMessageDialog(rootPane, "Error: unable to write to patch.");
                            }
                        } else {
                            JOptionPane.showMessageDialog(rootPane, "Error: unable to read patch.");
                        }
                    }
                }
            } catch(Exception e) {
                patch = null;
            }
            closeAddContent();
        }
    }//GEN-LAST:event_jButton2ActionPerformed