烦死了,对JPanel中移除所有组件,不能监听。请大家看看:      InfoCol_Application.listPanel.removeAll();
    
     InfoCol_Application.listPanel.removeComponentListener(new  ComponentAdapter (){
     public void componentHidden(ComponentEvent e){
     new InfoCol_Application().updateBackImage();
     } 
      
     });
    
    
     InfoCol_Application.listPanel.removeContainerListener(new ContainerAdapter(){
    
     public void  componentRemoved(ContainerEvent e) {
     new InfoCol_Application().updateBackImage();
     }
      
    
     });
     都不行,我疯了

解决方案 »

  1.   

    没明白程序是什么意思。貌似看来楼主还没理解类和对象的概念,removeComponentListener(new  ComponentAdapter (){ ……这是个无意义的操作,因为你移除的是一个刚创建的原本不存在的listener。new InfoCol_Application().updateBackImage();这里同样。
      

  2.   

    应该是addComponentListener(new ContainerAdapter(){
        public void  componentRemoved(ContainerEvent e) {
        new InfoCol_Application().updateBackImage();
        }   
        });
    吧。
    你把方法名称的意思理解错了吧,还没有注册litener, 怎么就删除lietener了。