Example usage for javax.swing KeyStroke getKeyStroke

List of usage examples for javax.swing KeyStroke getKeyStroke

Introduction

In this page you can find the example usage for javax.swing KeyStroke getKeyStroke.

Prototype

public static KeyStroke getKeyStroke(int keyCode, int modifiers) 

Source Link

Document

Returns a shared instance of a KeyStroke, given a numeric key code and a set of modifiers.

Usage

From source file:br.com.atmatech.sac.view.ViewAtendimento.java

private void inicializaAtalhos() {
    KeyStroke keyStrokeJBalterar = KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0);
    String actionNameJBalterar = "TECLA_F2";
    InputMap inputMapJBalterar = jBalterar.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    inputMapJBalterar.put(keyStrokeJBalterar, actionNameJBalterar);
    ActionMap actionMapJBMARCA = jBalterar.getActionMap();
    actionMapJBMARCA.put(actionNameJBalterar, acaojBnovo);

    //Atalho excluir
    KeyStroke keyStrokeJBexcluir = KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0);
    String actionNameJBexcluir = "F4";
    InputMap inputMapJBexcluir = jBexcluir.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    inputMapJBexcluir.put(keyStrokeJBexcluir, actionNameJBexcluir);
    ActionMap actionMapJBexcluir = jBexcluir.getActionMap();
    actionMapJBexcluir.put(actionNameJBexcluir, acaoJBexcluir);

    //aTALHO AJUDA
    KeyStroke keyStrokeJBajuda = KeyStroke.getKeyStroke(KeyEvent.VK_F9, 0);
    String actionNameJBajuda = "TECLA_F9";
    InputMap inputMapJBajuda = jBajuda.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    inputMapJBajuda.put(keyStrokeJBajuda, actionNameJBajuda);
    ActionMap actionMapJBajuda = jBajuda.getActionMap();
    actionMapJBajuda.put(actionNameJBajuda, acaoJBajuda);

    //Atalho enter
    InputMap inputMapJBenter = this.jDcombocliente.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    inputMapJBenter.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "forward");
    this.jDcombocliente.getRootPane().setInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, inputMapJBenter);
    this.jDcombocliente.getRootPane().getActionMap().put("forward", new AbstractAction() {
        private static final long serialVersionUID = 1L;

        @Override/*from  www  .  j  a  v  a  2s .co m*/
        public void actionPerformed(ActionEvent e) {
            selecionaCliente();
        }

    });
}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Create the model menu//from  www .j a  v  a  2 s  . com
 * 
 * @return The model menu
 */
private JMenu setupModelMenu() {
    final JMenu menu = new JMenu("Model");

    menu.setMnemonic(KeyEvent.VK_M);
    menu.setToolTipText("Menu items related to viewing the model");

    modelCreateTreeView = new JMenuItem("Create Tree");
    modelCreateTreeView.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, ActionEvent.ALT_MASK));
    modelCreateTreeView.setMnemonic(KeyEvent.VK_T);
    modelCreateTreeView.setToolTipText("Create tree representation of current model");
    modelCreateTreeView.addActionListener(new GenerateTreeListener());
    menu.add(modelCreateTreeView);

    modelListInferredTriples = new JMenuItem("Identify Inferred Triples");
    modelListInferredTriples.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK));
    modelListInferredTriples.setMnemonic(KeyEvent.VK_I);
    modelListInferredTriples.setToolTipText("Create a list of inferred triples from the current model");
    modelListInferredTriples.addActionListener(new GenerateInferredTriplesListener());
    menu.add(modelListInferredTriples);

    menu.addSeparator();

    filterResetTree = new JMenuItem("Clear Tree");
    filterResetTree
            .setToolTipText("Remove the tree view of the ontology. This may help if memory is running low");
    filterResetTree.addActionListener(new ClearTreeModelListener());
    menu.add(filterResetTree);

    return menu;
}

From source file:br.com.atmatech.sac.view.ViewPessoa.java

private void inicializaAtalhos() {
        //Atalho novo
        KeyStroke keyStrokeJBnovo = KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0);
        String actionNameJBnovo = "F1";
        InputMap inputMapJBnovo = jBnovo.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

        inputMapJBnovo.put(keyStrokeJBnovo, actionNameJBnovo);
        ActionMap actionMapJBnovo = jBnovo.getActionMap();
        actionMapJBnovo.put(actionNameJBnovo, acaoJBnovo);

        //Atalho alterar
        KeyStroke keyStrokeJBalterar = KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0);
        String actionNameJBalterar = "F3";
        InputMap inputMapJBalterar = jBalterar.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

        inputMapJBalterar.put(keyStrokeJBalterar, actionNameJBalterar);
        ActionMap actionMapJBalterar = jBalterar.getActionMap();
        actionMapJBalterar.put(actionNameJBalterar, acaoJBalterar);

        //Atalho salvar
        KeyStroke keyStrokeJBsalvar = KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0);
        String actionNameJBsalvar = "F2";
        InputMap inputMapJBsalvar = jBsalvar.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

        inputMapJBsalvar.put(keyStrokeJBsalvar, actionNameJBsalvar);
        ActionMap actionMapJBsalvar = jBsalvar.getActionMap();
        actionMapJBsalvar.put(actionNameJBsalvar, acaoJBsalvar);

        //Atalho excluir
        KeyStroke keyStrokeJBexcluir = KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0);
        String actionNameJBexcluir = "F4";
        InputMap inputMapJBexcluir = jBexcluir.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

        inputMapJBexcluir.put(keyStrokeJBexcluir, actionNameJBexcluir);
        ActionMap actionMapJBexcluir = jBexcluir.getActionMap();
        actionMapJBexcluir.put(actionNameJBexcluir, acaoJBexcluir);

        //Atalho cancelar
        //        KeyStroke keyStrokeJBcancelar = KeyStroke.getKeyStroke(KeyEvent.VK_F5,0);
        //        String actionNameJBcancelar = "F5";
        //        InputMap inputMapJBcancelar = jBcancelar.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        ///*  w  w w  . j  a v a 2 s . com*/
        //        inputMapJBcancelar.put(keyStrokeJBcancelar, actionNameJBcancelar);
        //        ActionMap actionMapJBcancelar = jBcancelar.getActionMap();
        //        actionMapJBcancelar.put(actionMapJBcancelar, acaoJBcancelar);
    }

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Create the help menu//from w  ww  .  j a  v  a2s.c om
 * 
 * @return The help menu
 */
private JMenu setupHelpMenu() {
    final JMenu menu = new JMenu("Help");

    menu.setMnemonic(KeyEvent.VK_H);
    menu.setToolTipText("Menu items related to user assistance");

    helpOverviewVideo = new JMenuItem("8 Minute Overview Video");
    helpOverviewVideo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.ALT_MASK));
    helpOverviewVideo.setMnemonic(KeyEvent.VK_V);
    helpOverviewVideo.setToolTipText("View an 8 minute overview of Semantic Workbench");
    helpOverviewVideo.addActionListener(new OverviewVideoListener());
    menu.add(helpOverviewVideo);

    helpAbout = new JMenuItem("About");
    helpAbout.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.ALT_MASK));
    helpAbout.setMnemonic(KeyEvent.VK_A);
    helpAbout.setToolTipText("View version information");
    helpAbout.addActionListener(new AboutListener());
    menu.add(helpAbout);

    return menu;
}

From source file:edu.ku.brc.ui.UIHelper.java

private static void buildKeyStrokeForCommandTypes(final int[] keys, final int[] mods) {
    int i = 0;//from   w ww .j a v a 2s  . co m
    for (CommandType cmdType : CommandType.values()) {
        cmdTypeKSHash.put(cmdType, KeyStroke.getKeyStroke(keys[i], mods[i]));
        i++;
    }
}

From source file:com.projity.pm.graphic.frames.GraphicManager.java

private void addCtrlAccel(int vk, String actionConstant, Action action) {
    RootPaneContainer root = (RootPaneContainer) container;
    InputMap inputMap = root.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    KeyStroke key = KeyStroke.getKeyStroke(vk, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()); //claur use getMenuShortcutKeyMask so it work on Mac too.
    inputMap.put(key, actionConstant);/*from w w w  .  j  av  a 2 s . com*/
    if (action == null)
        action = menuManager.getActionFromId(actionConstant);
    root.getRootPane().getActionMap().put(actionConstant, action);
}

From source file:edu.ku.brc.ui.UIHelper.java

/**
 * Helper for adding KeyBindings./* ww w. j  av a 2  s  .c  o m*/
 * @param comp the component (usually a JButton)
 * @param action the action to be invoked
 * @param actionName the name to put into the map for the action
 * @param keyCode the key code
 * @param modifier the modifer
 */
public static void addKeyBinding(final JComponent comp, final Action action, final String actionName,
        final int keyCode, final int modifier) {
    KeyStroke ctrlS = KeyStroke.getKeyStroke(keyCode, modifier);
    InputMap inputMap = comp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);

    inputMap.put(ctrlS, actionName);
    ActionMap actionMap = comp.getActionMap();
    actionMap.put(actionName, action);
}

From source file:com.osparking.osparking.Settings_System.java

private void makeEnterActAsTab() {
    KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    KeyStroke tab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0);
    KeyStroke ctrlTab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, KeyEvent.CTRL_DOWN_MASK);
    Set<KeyStroke> keys = new HashSet<>();
    keys.add(enter);//  w  w  w.j  a  v  a  2 s.  c om
    keys.add(tab);
    keys.add(ctrlTab);
    KeyboardFocusManager.getCurrentKeyboardFocusManager()
            .setDefaultFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, keys);
}

From source file:com.android.tools.idea.uibuilder.handlers.ui.AppBarConfigurationDialog.java

public AppBarConfigurationDialog(@NotNull ViewEditor editor) {
    myEditor = editor;/*from w w  w . java 2 s  . c  om*/
    setTitle(DIALOG_TITLE);
    setContentPane(myContentPane);
    setModal(true);
    getRootPane().setDefaultButton(myButtonOK);
    myBackgroundImage = DEFAULT_BACKGROUND_IMAGE;
    myFloatingActionButtonImage = DEFAULT_FAB_IMAGE;
    final ActionListener updatePreviewListener = event -> {
        updateControls();
        generatePreviews();
    };
    myWithTabs.addActionListener(updatePreviewListener);
    myTabCount.setValue(3);
    myCollapsing.addActionListener(updatePreviewListener);
    myShowBackgroundImage.addActionListener(updatePreviewListener);
    myFloatingActionButton.addActionListener(updatePreviewListener);
    myFitStatusBar.addActionListener(updatePreviewListener);
    myParallax.addActionListener(updatePreviewListener);
    myContentOverlap.addActionListener(updatePreviewListener);
    myContentOverlapAmount.addActionListener(updatePreviewListener);
    ((GridLayoutManager) myPreviewPanel.getLayout()).setRowStretch(0, 2);
    myTabCount.addChangeListener(event -> generatePreviews());

    final ActionListener actionListener = event -> {
        if (event.getSource() == myBackgroundImageSelector) {
            String src = myEditor.displayResourceInput(EnumSet.of(ResourceType.DRAWABLE));
            if (src != null) {
                myBackgroundImage = src;
                generatePreviews();
            }
        } else if (event.getSource() == myFloatingActionButtonImageSelector) {
            String src = myEditor.displayResourceInput(EnumSet.of(ResourceType.DRAWABLE));
            if (src != null) {
                myFloatingActionButtonImage = src;
                generatePreviews();
            }
        } else if (event.getSource() == myButtonOK) {
            onOK();
        } else if (event.getSource() == myButtonCancel || event.getSource() == myContentPane) {
            onCancel();
        }
    };
    myBackgroundImageSelector.addActionListener(actionListener);
    myFloatingActionButtonImageSelector.addActionListener(actionListener);
    myButtonOK.addActionListener(actionListener);
    myButtonCancel.addActionListener(actionListener);
    myContentPane.registerKeyboardAction(actionListener, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
            JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

    myPreviewPanel.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(final ComponentEvent e) {
            updatePreviewImages();
        }
    });

    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            onCancel();
        }
    });
}

From source file:nl.detoren.ijsco.ui.Mainscreen.java

private void addMenubar() {
    // Menu bar met 1 niveau
    Mainscreen ms = this;
    JMenuBar menubar = new JMenuBar();
    JMenu filemenu = new JMenu("Bestand");
    // File menu/*from  ww  w  .j  a v  a 2  s .  com*/
    JMenuItem item;
    /*      item = new JMenuItem("Openen...");
          item.setAccelerator(KeyStroke.getKeyStroke('O', Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask()));
            
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent arg0) {
    // Create a file chooser
    final JFileChooser fc = new JFileChooser();
    fc.setCurrentDirectory(new File(System.getProperty("user.dir")));
    // In response to a button click:
    int returnVal = fc.showOpenDialog(ms);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
       File file = fc.getSelectedFile();
       logger.log(Level.INFO, "Opening: " + file.getAbsolutePath() + ".");
       //controller.leesBestand(file.getAbsolutePath());
       ms.repaint();
    }
             }
          });
          filemenu.add(item);
    */
    /*      item = new JMenuItem("Opslaan");
          item.setAccelerator(KeyStroke.getKeyStroke('S', Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask()));
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent arg0) {
    //controller.saveState(true, "save");
             }
          });
          filemenu.add(item);
    */
    filemenu.addSeparator();
    item = new JMenuItem("Instellingen...");
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            actieInstellingen();
        }
    });
    item.setAccelerator(KeyStroke.getKeyStroke('I', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    filemenu.add(item);
    filemenu.addSeparator();
    item = new JMenuItem("Afsluiten");
    item.setAccelerator(KeyStroke.getKeyStroke('Q', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            controller.saveState(false, null);
            System.exit(EXIT_ON_CLOSE);
        }
    });
    filemenu.add(item);
    menubar.add(filemenu);

    /**
     *  Toernooi menu 
      */

    JMenu toernooimenu = new JMenu("Toernooi");
    item = new JMenuItem("Toernooiinformatie");
    item.setAccelerator(KeyStroke.getKeyStroke('T', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            //actieNieuweSpeler(null, null);
            bewerkToernooi();
            hoofdPanel.repaint();
        }
    });
    toernooimenu.add(item);
    menubar.add(toernooimenu);

    /**
     *  Spelersdatabase menu 
      */

    JMenu spelermenu = new JMenu("Spelersdatabase");

    item = new JMenuItem("OSBO JSON lijst ophalen (Online)");
    item.setAccelerator(KeyStroke.getKeyStroke('J', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            //actieNieuweSpeler(null, null);
            leeslijstOnline("www.osbo.nl", "/jeugd/currentratings.json");
            hoofdPanel.repaint();
        }
    });
    spelermenu.add(item);

    item = new JMenuItem("OSBO htmllijst ophalen !verouderd! (Online)");
    item.setAccelerator(KeyStroke.getKeyStroke('O', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            //actieNieuweSpeler(null, null);
            leeslijstOnline("www.osbo.nl", "/jeugd/jrating.htm");
            hoofdPanel.repaint();
        }
    });
    spelermenu.add(item);

    item = new JMenuItem("OSBO/IJSCO compatible lijst inlezen (Bestand)");
    item.setAccelerator(KeyStroke.getKeyStroke('L', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            // Create a file chooser
            final JFileChooser fc = new JFileChooser();
            fc.setCurrentDirectory(new File(System.getProperty("user.dir")));
            // In response to a button click:
            int returnVal = fc.showOpenDialog(ms);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = fc.getSelectedFile();
                logger.log(Level.INFO, "Opening: " + file.getAbsolutePath() + ".");
                leesOSBOlijstBestand(file.getAbsolutePath());
            }
            hoofdPanel.repaint();
        }
    });
    spelermenu.add(item);

    /*      item = new JMenuItem("Groslijst CSV inlezen (Bestand) N/A");
          item.setAccelerator(KeyStroke.getKeyStroke('C', Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask()));
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
    //actieNieuweSpeler(null, null);
    // Create a file chooser
    final JFileChooser fc = new JFileChooser();
    fc.setCurrentDirectory(new File(System.getProperty("user.dir")));
    // In response to a button click:
    int returnVal = fc.showOpenDialog(ms);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
       File file = fc.getSelectedFile();
       logger.log(Level.INFO, "Opening: " + file.getAbsolutePath() + ".");
       leesCSV(file.getAbsolutePath());
    }
    hoofdPanel.repaint();
             }
          });
          spelermenu.add(item);
    */
    menubar.add(spelermenu);

    JMenu deelnemersmenu = new JMenu("Deelnemers");

    item = new JMenuItem("Wis Deelnemerslijst");
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            // Create a file chooser
            wisDeelnemers();
            hoofdPanel.repaint();
        }
    });
    deelnemersmenu.add(item);

    item = new JMenuItem("Importeren Deelnemerslijst");
    item.setAccelerator(KeyStroke.getKeyStroke('I', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            // Create a file chooser
            final JFileChooser fc = new JFileChooser();
            fc.setCurrentDirectory(new File(System.getProperty("user.dir")));
            // In response to a button click:
            int returnVal = fc.showOpenDialog(ms);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = fc.getSelectedFile();
                logger.log(Level.INFO, "Opening: " + file.getAbsolutePath() + ".");
                leesDeelnemers(file.getAbsolutePath());
            }
            hoofdPanel.repaint();
        }
    });
    deelnemersmenu.add(item);

    item = new JMenuItem("Export Deelnemerslijst (JSON)");
    item.setAccelerator(KeyStroke.getKeyStroke('E', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            // Create a file chooser
            final JFileChooser fc = new JFileChooser();
            FileNameExtensionFilter filter = new FileNameExtensionFilter("JSON", "json");
            fc.setFileFilter(filter);
            fc.setCurrentDirectory(new File(System.getProperty("user.dir")));
            // In response to a button click:
            int returnVal = fc.showSaveDialog(ms);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = fc.getSelectedFile();
                logger.log(Level.INFO, "Opening: " + file.getAbsolutePath() + ".");
                schrijfDeelnemers(file.getAbsolutePath());
            }
            hoofdPanel.repaint();
        }
    });
    deelnemersmenu.add(item);

    menubar.add(deelnemersmenu);

    JMenu uitslagenmenu = new JMenu("Uitslagen");
    Component hs = this;
    item = new JMenuItem("Importeer uitslagenbestand");
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            // Create a file chooser
            final JFileChooser fc = new JFileChooser();
            fc.setCurrentDirectory(new File(System.getProperty("user.dir")));

            // In response to a button click:
            int returnVal = fc.showOpenDialog(hs);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = fc.getSelectedFile();
                logger.log(Level.INFO, "Opening: " + file.getAbsolutePath() + ".");
                status.groepenuitslagen = (GroepsUitslagen) new ExcelImport().importeerUitslagen(file);
                OutputUitslagen ou = new OutputUitslagen();
                ou.exportuitslagen(status.groepenuitslagen);
                IJSCOController.t().wisUitslagen();
                ou.exportJSON(status.groepenuitslagen);
                GroepsUitslagen verwerkteUitslag = new Uitslagverwerker()
                        .verwerkUitslag(status.groepenuitslagen);
                logger.log(Level.INFO, verwerkteUitslag.ToString());
                new OutputUitslagen().exporteindresultaten(verwerkteUitslag);
                JOptionPane.showMessageDialog(null, "Uitslagen geimporteerd en bestanden aangemaakt.");
            }
            hoofdPanel.repaint();
        }
    });

    uitslagenmenu.add(item);
    menubar.add(uitslagenmenu);

    JMenu osbomenu = new JMenu("OSBO");

    item = new JMenuItem("Verstuur uitslagen handmatig.");
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            // Create a file chooser
            SendAttachmentInEmail SAIM = new SendAttachmentInEmail();
            SAIM.sendAttachement("Uitslagen.json");
            hoofdPanel.repaint();
        }
    });

    osbomenu.add(item);
    menubar.add(osbomenu);

    JMenu helpmenu = new JMenu("Help");

    item = new JMenuItem("Verstuur logging");
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            // Create a file chooser
            SendAttachmentInEmail SAIM = new SendAttachmentInEmail();
            SAIM.sendAttachement("IJSCO_UI.log");
            hoofdPanel.repaint();
        }
    });

    helpmenu.add(item);
    item = new JMenuItem("About");
    item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            AboutDialog ad = new AboutDialog(ms);
            ad.setVisible(true);
            hoofdPanel.repaint();
        }
    });

    helpmenu.add(item);
    menubar.add(helpmenu);

    /*      JMenu indelingMenu = new JMenu("Indeling");
          //item = new JMenuItem("Automatisch aan/uit");
          item = new JMenuItem("N/A");
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent event) {
    //actieAutomatisch();
             }
          });
            
          indelingMenu.add(item);
          //item = new JMenuItem("Maak wedstrijdgroep");
          item = new JMenuItem("N/A");
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
    //actieMaakWedstrijdgroep();
             }
          });
            
          indelingMenu.add(item);
          //item = new JMenuItem("Maak speelschema");
          item = new JMenuItem("N/A");
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent evetn) {
    //actieMaakSpeelschema();
             }
          });
          indelingMenu.add(item);
          //item = new JMenuItem("Bewerk speelschema");
          item = new JMenuItem("N/A");
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent event) {
    //updateAutomatisch(false);
    // ResultaatDialoog
    //actieBewerkSchema();
             }
          });
            
          indelingMenu.add(item);
          indelingMenu.addSeparator();
          //item = new JMenuItem("Export");
          item = new JMenuItem("N/A");
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent event) {
    //actieExport();
             }
          });
          indelingMenu.add(item);
          indelingMenu.addSeparator();
          //item = new JMenuItem("Vul uitslagen in");
          item = new JMenuItem("N/A");
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
    //actieVoerUitslagenIn();
             }
          });
          indelingMenu.add(item);
          //item = new JMenuItem("Externe spelers");
          item = new JMenuItem("N/A");
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
    //actieExterneSpelers();
             }
          });
          indelingMenu.add(item);
          //item = new JMenuItem("Maak nieuwe stand");
          item = new JMenuItem("N/A");
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
    //actieUpdateStand();
             }
          });
          indelingMenu.add(item);
          indelingMenu.addSeparator();
          //item = new JMenuItem("Volgende ronde");
          item = new JMenuItem("N/A");
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
    //actieVolgendeRonde();
             }
          });
          indelingMenu.add(item);
          menubar.add(indelingMenu);
    */
    /*      JMenu overigmenu = new JMenu("Overig");
            
          //item = new JMenuItem("Reset punten");
          item = new JMenuItem("N/A");
          item.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
    //controller.resetPunten();
    hoofdPanel.repaint();
             }
          });
            
          overigmenu.add(item);
          menubar.add(overigmenu);
    */
    this.setJMenuBar(menubar);

}