Java Code Examples for javax.swing.JComponent.setInheritsPopupMenu()

The following are Jave code examples for showing how to use setInheritsPopupMenu() of the javax.swing.JComponent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: OpenJSharp   File: ColorChooserPanel.java   View Source Code Vote up 5 votes
/**
 * Allows to show context popup for all components recursively.
 *
 * @param component  the root component of the tree
 * @param value      whether or not the popup menu is inherited
 */
private static void setInheritsPopupMenu(JComponent component, boolean value) {
    component.setInheritsPopupMenu(value);
    for (Object object : component.getComponents()) {
        if (object instanceof JComponent) {
            setInheritsPopupMenu((JComponent) object, value);
        }
    }
}
 
Example 2
Project: jdk8u-jdk   File: ColorChooserPanel.java   View Source Code Vote up 5 votes
/**
 * Allows to show context popup for all components recursively.
 *
 * @param component  the root component of the tree
 * @param value      whether or not the popup menu is inherited
 */
private static void setInheritsPopupMenu(JComponent component, boolean value) {
    component.setInheritsPopupMenu(value);
    for (Object object : component.getComponents()) {
        if (object instanceof JComponent) {
            setInheritsPopupMenu((JComponent) object, value);
        }
    }
}
 
Example 3
Project: openjdk-jdk10   File: ColorChooserPanel.java   View Source Code Vote up 5 votes
/**
 * Allows to show context popup for all components recursively.
 *
 * @param component  the root component of the tree
 * @param value      whether or not the popup menu is inherited
 */
private static void setInheritsPopupMenu(JComponent component, boolean value) {
    component.setInheritsPopupMenu(value);
    for (Object object : component.getComponents()) {
        if (object instanceof JComponent) {
            setInheritsPopupMenu((JComponent) object, value);
        }
    }
}