0

I'd like to handle the case where the mouse goes over any of the JMenuItems. I don't need the user to click one of the JMenuItems; simply to move the mouse over any of them. Basically, he has to click the JMenuBar to show the menus, but he doesn't have to click any menu item.

I wanted to use an actionPerformed listener on the JMenuBar - since the menu items and submenus only appear once the user clicks the JMenuBar - but that doesn't seem to be possible, unless I did something wrong.

1 Answers1

2

Implement a MouseListener and add it to the JMenuItems. Then you can catch when the mouse enters and leaves each JMenuItem.

Clint
  • 8,988
  • 1
  • 26
  • 40