写一个小型的网页浏览器,在做全屏显示这个功能的时候,遇到一个问题,全屏我是写了个window然后里面有个button2也就是还原原来窗口的功能,下面是监听器的代码,其中第三行WebBrowser.this.setEnabled(true)中 this指的什么啊,是原先那个JFrame中的JComponent么,或者怎么判断this的含义  button2.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
          WebBrowser.this.setEnabled(true);
          window.remove(bar);
          window.remove(toolBar);
          window.remove(scrollPane);
          window.setVisible(false);          scrollPane.setPreferredSize(new Dimension(100, 500));
          getContentPane().add(scrollPane, BorderLayout.SOUTH);
          getContentPane().add(bar, BorderLayout.CENTER);
          getContentPane().add(toolBar, BorderLayout.NORTH);
          bar.remove(button2);
          pack();        }

解决方案 »

  1.   

    在一个匿名内部类里面,this就不是代表WebBrowser本身了
    相当于
    class WebBrowser{
       class InnerClass{
         //这里的时候不是WebBrowser,所以用WebBrowser.this
        }
    }
      

  2.   

    找到资料了,一起学习
    http://www.qqread.com/java/2007/05/d311628.html
      

  3.   

    那还有就是关于这个setEnable是哪个类的方法,我查类库发现有很多类,有JComponent还有一些接口,不知道是哪个
      

  4.   

    你有工具吗?我用eclipse可以打开“类层次结构”将其继承的类全部找出来,需要一个一个的找