public EventManager() {
    helpButton = new JLabel("<html><a href=\"#\">Help</a></html>");
    helpButton.setAlignmentX(SwingConstants.RIGHT);
    helpButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); //link
    helpButton.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent me) {
        if (helpFrame != null) helpFrame.dispose();
        try {
          helpFrame = new HelpFrame();
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    });
    step1 = new JLabel();
    step1.setHorizontalAlignment(SwingConstants.LEFT);
    step1.setFont(Main.normalFont.deriveFont(13.0f));
    step1.setText("<html><b>Step 1.</b> Load the automaton using <a href=\"\">Backus-Naur Form</a>.</html>");
    step1.setCursor(new Cursor(Cursor.HAND_CURSOR)); //link
    step1.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent me) {
        try {
          Desktop.getDesktop().browse(new URI("http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form"));
        } catch (Exception e) {
          e.printStackTrace(); //???
        }
      }
    });
    editorBN = new JTextArea(); //Backus-Naur editor
    //editorBN.setLineWrap(true);
    //editorBN.setWrapStyleWord(true);
    editorBN.setDisabledTextColor(Color.darkGray);
    editorBN.setMargin(new Insets(5, 5, 5, 5)); //inside padding
    editorBN.setFont(Main.monospaceFont.deriveFont(13.0f));
    scrollPaneBN = new JScrollPane(editorBN);
    
    promptBN = new JLabel("<html>Enter the Backus-Naur form on the left,<br/>" +
                                "Or load from file/examples:</html>");
    promptBN.setFont(Main.normalFont.deriveFont(13.0f));
    
    optionsBN = new JComboBox<String>(); //for selecting examples
    optionsBN.setFont(Main.monospaceFont.deriveFont(13.0f));
    optionsBN.addActionListener(this);
    
    promptDicts = new JLabel("<html>Select a default dictionary,<br/>" +
                                  "Or load your custom one from file:</html>");
    promptDicts.setFont(Main.normalFont.deriveFont(13.0f));

    optionsDicts = new JComboBox<String>(); //for selecting dictionaries
    optionsDicts.setFont(Main.monospaceFont.deriveFont(13.0f));
    
    lockButton = new JButton("Lock and Load");
    lockButton.setFont(Main.normalFont.deriveFont(Font.BOLD, 13.0f));
    lockButton.setActionCommand("Load");
    lockButton.addActionListener(this);
    
    step2 = new JLabel();
    step2.setHorizontalAlignment(SwingConstants.LEFT);
    step2.setFont(Main.normalFont.deriveFont(13.0f));
    step2.setText("<html><b>Step 2.</b> Load your input text to be analyzed.");
    
    promptTexts = new JLabel("<html>Load a block text to be analyzed,<br/>" +
                                    "From examples, or from file:</html>");
    promptTexts.setFont(Main.normalFont.deriveFont(13.0f));
    optionsTexts = new JComboBox<String>(); //for loading input example texts
    optionsTexts.setFont(Main.monospaceFont.deriveFont(13.0f));
    optionsTexts.addActionListener(this);
    
    promptSymbols = new JLabel("<html>Select a symbol to match:</html>");
    promptSymbols.setFont(Main.normalFont.deriveFont(13.0f));
    optionsSymbols = new JComboBox<String>();
    optionsSymbols.setFont(Main.monospaceFont.deriveFont(13.0f));
    
    step3 = new JLabel();
    step3.setHorizontalAlignment(SwingConstants.LEFT);
    step3.setFont(Main.normalFont.deriveFont(13.0f));
    step3.setText("<html><b>Step 3.</b> Break it down!");
    
    analyzeButton = new JButton("Analyze");
    analyzeButton.setFont(Main.normalFont.deriveFont(Font.BOLD, 13.0f));
    analyzeButton.setActionCommand("Analyze");
    analyzeButton.addActionListener(this);
    
    resetButton = new JButton("Reset All");
    resetButton.setFont(Main.normalFont.deriveFont(Font.BOLD, 13.0f));
    resetButton.setActionCommand("Reset");
    resetButton.addActionListener(this);
    
    editorText = new JTextArea();
    //editorIn.setLineWrap(true);
    //editorIn.setWrapStyleWord(true);
    editorText.setDisabledTextColor(Color.darkGray);
    editorText.setMargin(new Insets(5, 5, 5, 5)); //inside padding
    editorText.setFont(Main.monospaceFont.deriveFont(13.0f));
    scrollPaneText = new JScrollPane(editorText);
    
    //Create a status bar at the bottom
    statusPanel = new JPanel();
    statusPanel.setBorder(new BevelBorder(BevelBorder.LOWERED));
    statusPanel.setPreferredSize(new Dimension(Main.WIDTH, 20));
    statusPanel.setLayout(new BoxLayout(statusPanel, BoxLayout.X_AXIS));
    
    statusLabel = new JLabel("Status: Ready");
    statusLabel.setHorizontalAlignment(SwingConstants.LEFT);
    statusPanel.add(statusLabel);
    
    loadExampleBN();
    loadExampleDicts();
    loadExampleTexts();
    refresh();
  }