void (MouseEvent e) { MenuSelectionManager manager=MenuSelectionManager.defaultManager(); Point p = e.getPoint(); if (p.x >= 0 && p.x < menuItem.getWidth() && p.y >= 0 && p.y < menuItem.getHeight()) { if (e.getButton() == MouseEvent.BUTTON1) { doClick(manager, e); } } else { manager.processMouseEvent(e); } }