MenuFakeSupport.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:incubator-netbeans 作者:
@Override
public void addComponentsToContainer(Container container,
                                     Container containerDelegate,
                                     Component[] components,
                                     int index)
{
    for (int i=0; i < components.length; i++) {
        containerDelegate.add(components[i], i + index);
        // Issue 110587 - the default background of menu depends (on some l&f)
        // on the location of the menu (if it is top-level menu or not).
        // The background is changed when "ancestor" property change event
        // is fired. This usually happens when addNotify() is called.
        // Unfortunately, addNotify() is not called if the parent doesn't
        // have peer - this happens for model instances. The following
        // code fires the property change event explicitly to force
        // update of the background.
        PropertyChangeEvent event = new PropertyChangeEvent(components[i], "ancestor", null, container); // NOI18N
        for (PropertyChangeListener listener : components[i].getPropertyChangeListeners()) {
            listener.propertyChange(event);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号