List of usage examples for javax.swing JPopupMenu isVisible
public boolean isVisible()
From source file:Main.java
/** * Repaints UI tree recursively.// ww w . j ava 2s . c om * * @param c UI component. */ private static void updateComponentTreeUI0(Component c) { if (c instanceof JComponent) { JComponent jc = (JComponent) c; jc.invalidate(); jc.validate(); jc.repaint(); JPopupMenu jpm = jc.getComponentPopupMenu(); if (jpm != null && jpm.isVisible() && jpm.getInvoker() == jc) { updateComponentTreeUI(jpm); } } Component[] children = null; if (c instanceof JMenu) { children = ((JMenu) c).getMenuComponents(); } else if (c instanceof java.awt.Container) { children = ((java.awt.Container) c).getComponents(); } if (children != null) { for (int i = 0; i < children.length; i++) updateComponentTreeUI0(children[i]); } }