public void actionPerformed(ActionEvent e)
    {
        if (e.getSource().equals(edit))
        {
            if(RecipeListPanel.recipeSelected == null)
                JOptionPane.showMessageDialog(null, "You currently have no recipe "
                    + "selected. Please select a recipe and try again");
            else
            {
                Driver.rightPanel.setVisible(false);
                Driver.addPanel.setVisible(false);
                Driver.editPanel.setVisible(true);
                Driver.editPanel.setRecipe(RecipeListPanel.recipeSelected);
            }

            
        }
        if(e.getSource().equals(add))
        {
            Driver.rightPanel.setVisible(false);
            Driver.editPanel.setVisible(false);
            Driver.addPanel.setVisible(true);
        }
        if(e.getSource().equals(delete))
        {
            int reply = JOptionPane.showConfirmDialog(null, "Are you sure you want to delete"
                    + " this recipe?", "Delete Recipe", JOptionPane.YES_NO_OPTION);
            if(reply == JOptionPane.YES_OPTION)
            {
                try {
                    if(RecipeListPanel.recipeSelected == null)
                        JOptionPane.showMessageDialog(null, "You need to select a recipe first");
                    else
                    {
                        data.init();
                        data.deleteRecipe(RecipeListPanel.recipeSelected.recipeId);
                        listPanel.updateRecipeList(null);
                        this.updateCategoriesMenu(data.getCategories());
                    }
                }
                catch(Exception error)
                {
                    error.printStackTrace();
                }
                finally
                {
                    data.close();
                }
                
            }
            
        }
    }