toolMenu.addMouseMotionListener(new MouseAdapter(){
public void mouseMoved(MouseEvent e){
toolMenu.setPopupMenuVisible(true);
toolMenu.setEnabled(true);
fileMenu.setPopupMenuVisible(false);
editMenu.setPopupMenuVisible(false);
}
});
For each menu write MouseMotionListener,and when the mouse moved on specific menu make setPopupMenu(true) for the menu you move the mouse,and for others is false.