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

The following are Jave code examples for showing how to use getRootPane() 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: VISNode   File: HierarchyMouseDispatcher.java   View Source Code Vote up 5 votes
/**
 * Returns if the component is registered for the event
 * 
 * @param mouseEvent
 * @param listener
 * @return boolean
 */
private boolean isRegistered(MouseEvent mouseEvent, ListenerBean listener) {
    if (!(mouseEvent.getSource() instanceof JComponent)) {
        return false;
    }
    JComponent source = (JComponent) mouseEvent.getSource();
    JComponent listen = listener.component;
    if (source.getRootPane() != listen.getRootPane()) {
        return false;
    }
    return testHierarchy(source, listen);
}
 
Example 2
Project: incubator-netbeans   File: PopupManager.java   View Source Code Vote up 5 votes
/** Remove popup panel from previous textComponent root pane */
private void removeFromRootPane(JComponent c) {
    JRootPane rp = c.getRootPane();
    if (rp != null) {
        rp.getLayeredPane().remove(c);
    }
}