标题:我是JAVA初学者,遇到了以下困难 望高手指点
取消只看楼主
hbqzbl
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2011-12-21
结帖率:100%
已结贴  问题点数:20 回复次数:1 
我是JAVA初学者,遇到了以下困难 望高手指点
import java.awt.*;
import java.awt.event.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
public class three implements MouseMotionListener,MouseListener,WindowListener{
      private Frame f;
      private TextField tf;
      public static void main(String args[]){
        three thre=new three();
        thre.go();
      }
      public void go(){
      f=new Frame("我已经");
      f.add(new Label("嘿嘿"),"North");
      tf=new TextField(30);
      f.add(tf,"South");
      f.addMouseMotionListener(this);
      f.addMouseListener(this);
      f.addWindowListener(this);
      f.setSize(300,200);
      f.setVisible(true);
      }
      public void mouseDragged(MouseEvent e){
       String s="Mouse dragging : X="+e.getX()+"Y = "+e.getY();
       tf.setText(s);
       }
      public void mouseMoved(MouseEvent e){}
      public void mouseClicked(MouseEvent e){}
      public void mouseEntered(MouseEvent e){
       String s="The mouse Entered";
       tf.setText(s);
       }
      public void mouseExited(MouseEvent e){
       String s="The mouse has lefed the buiding";
       tf.setText(s);
       }
      public void mousePressed(MouseEvent e){}
      public void mouseReleased(MouseEvent e){}
      public void WindowClosing(WindowEvent e){
        System.exit(1);
       }
      public void WindowOpened(WindowEvent e){}
      public void WindowIconified(WindowEvent e){}
      public void WindowDeiconified(WindowEvent e){}
      public void WindowClosed(WindowEvent e){}
      public void WindowActivated(WindowEvent e){}
      public void WindowDeactivated(WindowEvent e){}
}

编译时出现以下错误
three.java:5: three 不是抽象的,并且未覆盖 java.awt.event.WindowListener 中的抽
象方法 windowDeactivated(java.awt.event.WindowEvent)
public class three implements MouseMotionListener,MouseListener,WindowListener{
搜索更多相关主题的帖子: class private public import 
2011-12-21 16:59
hbqzbl
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2011-12-21
得分:0 
谢谢。。。
2011-12-25 20:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-358316-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.183062 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved