Search in sources :

Example 1 with DialogAbout

use of com.jsql.view.swing.dialog.DialogAbout in project jsql-injection by ron190.

the class Menubar method initializeMenuHelp.

private JMenu initializeMenuHelp() {
    // Help Menu > about
    var menuHelp = new JMenu(I18nUtil.valueByKey("MENUBAR_HELP"));
    menuHelp.setMnemonic('H');
    I18nViewUtil.addComponentForKey("MENUBAR_HELP", menuHelp);
    menuHelp.setName("menuHelp");
    JMenuItem itemHelp = new JMenuItemWithMargin(I18nUtil.valueByKey("MENUBAR_HELP_ABOUT"), 'A');
    I18nViewUtil.addComponentForKey("MENUBAR_HELP_ABOUT", itemHelp);
    itemHelp.setName("itemHelp");
    JMenuItem itemUpdate = new JMenuItemWithMargin(I18nUtil.valueByKey("MENUBAR_HELP_UPDATE"), 'U');
    I18nViewUtil.addComponentForKey("MENUBAR_HELP_UPDATE", itemUpdate);
    // Render the About dialog behind scene
    final var aboutDiag = new DialogAbout();
    itemHelp.addActionListener(actionEvent -> {
        // Center the dialog
        if (!aboutDiag.isVisible()) {
            aboutDiag.initializeDialog();
            // needed here for button focus
            aboutDiag.setVisible(true);
            aboutDiag.requestButtonFocus();
        }
        aboutDiag.setVisible(true);
    });
    itemUpdate.addActionListener(new ActionCheckUpdate());
    menuHelp.add(itemUpdate);
    menuHelp.add(new JSeparator());
    menuHelp.add(itemHelp);
    return menuHelp;
}
Also used : DialogAbout(com.jsql.view.swing.dialog.DialogAbout) JMenuItem(javax.swing.JMenuItem) JMenu(javax.swing.JMenu) JSeparator(javax.swing.JSeparator)

Aggregations

DialogAbout (com.jsql.view.swing.dialog.DialogAbout)1 JMenu (javax.swing.JMenu)1 JMenuItem (javax.swing.JMenuItem)1 JSeparator (javax.swing.JSeparator)1