Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
The method addMouseListener(MouseListener) in the type Component is not applicable for the arguments (Ex9_8_) at Ex9_8_.<init>(Ex9_8_.java:10)
at Ex9_8_.main(Ex9_8_.java:22)

import java.awt.event.*;
import javax.swing.*;public class Ex9_8_ {
    JFrame f;
    public Ex9_8_(){
     f = new JFrame();
     f.setSize( 300,150 );
     f.show();
     f.addMouseListener(this);
     f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
    
    public void mousePressed(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
    public void mouseEntered(MouseEvent e){}
    public void mouseExited(MouseEvent e){}
    public void mouseClicked(MouseEvent e){
     f.setTitle( "点击坐标为(" + e.getX() + "," + e.getY() + ")"  );
    }
    public static void main( String args[] ){
     new Ex9_8_();
    }
}