private void exportToPDFButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportToPDFButtonActionPerformed
        if (evt.getSource() != exportToPDFButton)
            return;
        
        final File pdfLaTeXFile = Config.getPDFLaTeXFile();
        File workingDir = Config.getPDFExportFolder();
        if (workingDir == null) {
            final JFileChooser fc = new JFileChooser();
            fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            fc.setDialogTitle("Zvolte výstupnou složku");
        
            final int returnVal = fc.showOpenDialog(MainFrame.this);
            if (returnVal == JFileChooser.APPROVE_OPTION)
                workingDir = fc.getSelectedFile();
        }
        if (workingDir != null) {
            Utils.exportPDF(pdfLaTeXFile,
                    workingDir,
                    mathProblem.getProblemLaTeX(),
                    mathProblem.getSolutionLaTeX(),
                    this);
        }
    }//GEN-LAST:event_exportToPDFButtonActionPerformed