0

Hi!

Does anybody know how to add MouseListener to JMenu? I have the following working code, however, as you may see, I have MenuListener that allows running "createBaseRight" after selecting (NOT CLICKING) JMenu: home. Thanks in advance!

JMenuBar menubar = new JMenuBar();
        this.setJMenuBar(menubar);
        JMenu home = new JMenu("Начальная страница");
        menubar.add(home);
//...
        menubar.add(admin);

        home.addMenuListener(new MenuListener() {
              public void menuSelected(MenuEvent e) {
                createBaseRight(1);
              }
              public void menuDeselected(MenuEvent e) {
              }
              public void menuCanceled(MenuEvent e) {
              }
        });
3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by NormR1
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.