private void btnLoadRegExpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLoadRegExpActionPerformed
    String regExp = this.txtRegularExpression.getText();
    if(regExp.isEmpty()){
        JOptionPane.showMessageDialog(this,"Regular Expression field can't be empty.", "Invalid Regular Expression", JOptionPane.WARNING_MESSAGE);
        this.txtRegularExpression.requestFocus();
        return;
    }
    Parser parser = new Parser(regExp);
    
    RegularExpresionNode tree = null;
    try {
        tree = parser.Parse();
    } catch (ParserException ex) {
        JOptionPane.showMessageDialog(this,"Regular Expression has some invalid content: " + ex.getMessage(), "Invalid Regular Expression", JOptionPane.WARNING_MESSAGE);
        this.txtRegularExpression.requestFocus();
        return;
    }
    this.currentTree.generateAFNEAutomata(tree, this.chkboxRevert.isSelected());
    this.currentTree.setCurrentRegExp(regExp);
    this.manager.setContent(currentTree.getAFNE());
    try {
        manager.convertAFNtoAFD();
    } catch (JAXBException ex) {
        Logger.getLogger(RegExpForm.class.getName()).log(Level.SEVERE, null, ex);
    } catch (Exception ex) {
        Logger.getLogger(RegExpForm.class.getName()).log(Level.SEVERE, null, ex);
    }
    JOptionPane.showMessageDialog(this, "The Regular Expression: [" +  regExp + "] has been loaded succesfully.","Succesfuly Loaded", JOptionPane.INFORMATION_MESSAGE);
}//GEN-LAST:event_btnLoadRegExpActionPerformed