private void analyzeTextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_analyzeTextButtonActionPerformed
        // TODO add your handling code here:
        JFileChooser fileChooser = new JFileChooser();
        javax.swing.filechooser.FileFilter textFilter = new javax.swing.filechooser.FileFilter() {

            @Override
            public String getDescription() {
                return null;
            }

            @Override
            public boolean accept(File f) {
                if (f.getName().toLowerCase().endsWith("txt") || f.isDirectory()) {
                    return true;
                }
                return false;
            }
        };
        fileChooser.setFileFilter(textFilter);
        int actionSelected = fileChooser.showOpenDialog(logTextArea);
        if (actionSelected == JFileChooser.APPROVE_OPTION) {
            if (useHashMapRadioButton.isSelected()) {
                textAnalyzer = new TextAnalyzer("hashmap");
            } else {
                textAnalyzer = new TextAnalyzer("treemap");
            }
            long startTime = System.nanoTime();
            long endTime = 0;
            try {
                textAnalyzer.analyzeText(fileChooser.getSelectedFile().getPath());
                endTime = System.nanoTime();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
            logTextArea.append("File name: " + fileChooser.getSelectedFile().getName() + "\n");
            logTextArea.append("Number of unique words: " + textAnalyzer.getUniqueWordCount() + "\n");
            logTextArea.append("Total number of words: " + textAnalyzer.getWordCount() + "\n");
            logTextArea.append("Time taken to analyze the file: " + TimeUnit.NANOSECONDS.toMillis(endTime - startTime) + " milliseconds\n");
        }

    }//GEN-LAST:event_analyzeTextButtonActionPerformed