List of usage examples for javax.swing JMenu isVisible
@Transient public boolean isVisible()
From source file:processing.app.Base.java
private void filterVisibilityOfSubsequentBoardMenus(List<JMenu> boardsCustomMenus, TargetBoard board, int fromIndex) { for (int i = fromIndex; i < boardsCustomMenus.size(); i++) { JMenu menu = boardsCustomMenus.get(i); for (int m = 0; m < menu.getItemCount(); m++) { JMenuItem menuItem = menu.getItem(m); menuItem.setVisible(menuItem.getAction().getValue("board").equals(board)); }//from w w w .j a va 2s. com menu.setVisible(ifThereAreVisibleItemsOn(menu)); if (menu.isVisible()) { JMenuItem visibleSelectedOrFirstMenuItem = selectVisibleSelectedOrFirstMenuItem(menu); if (!visibleSelectedOrFirstMenuItem.isSelected()) { visibleSelectedOrFirstMenuItem.setSelected(true); visibleSelectedOrFirstMenuItem.getAction().actionPerformed(null); } } } }