private void tagButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tagButtonActionPerformed
        try {
            // initializes the available colors as styles
            Style style = taggedTextPane.addStyle(getColor(0), null);
            StyleConstants.setForeground(style, Color.decode(getColor(0)));
            for (int i=1; i<15; i++)
            {
                style = taggedTextPane.addStyle(getColor(i), null);
                StyleConstants.setForeground(style, Color.decode(getColor(i)));
            }
            
            // inserts each tagged word into the tagged text pane and colors
            taggedTextPane.setText("");
            ArrayList<ArrayList<Pair<String, POS>>> sentenceList = parser.parse(textEditorPane.getText());
            for (int i=0; i<sentenceList.size(); i++) {
                for (int j=0; j<sentenceList.get(i).size(); j++) {
                    StyledDocument doc = taggedTextPane.getStyledDocument();
                    try {
                        doc.insertString(doc.getLength(), sentenceList.get(i).get(j).get_first(),
                                taggedTextPane.getStyle(getColor(sentenceList.get(i).get(j).get_second().getgIndex())));
                    } catch (BadLocationException ex) {
                        Logger.getLogger(TextEditor.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }
            
            dictionaryText.setText("");
            thesaurusText.setText("");
        } catch (POSNotFoundException ex) {
            Logger.getLogger(TextEditor.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_tagButtonActionPerformed