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;
}
Aggregations