List of usage examples for javax.swing Action equals
public boolean equals(Object obj)
From source file:Main.java
/** * Finds a {@link JMenu} for the given {@link Action} within the given * menu.// ww w . ja v a 2 s . c o m * * @param menu * @param action * @return */ public static JMenu findMenu(JMenu menu, Action action) { if (action.equals(menu.getAction())) { return menu; } for (Component comp : menu.getMenuComponents()) { if (comp instanceof JMenu) { if (((JMenu) comp).getAction().equals(action)) { return (JMenu) comp; } return findMenu((JMenu) comp, action); } } return null; }