List of usage examples for javax.swing JComponent getComponentPopupMenu
@SuppressWarnings("deprecation") public JPopupMenu getComponentPopupMenu()
JPopupMenu
that assigned for this component. From source file:Main.java
/** * Repaints UI tree recursively.//from ww w. j av a 2 s . 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]); } }