![](https://cos-cdn.shuashuati.com/pipixue-wap/2020-1230-1107-53/ti_inject-812ce.png)
阅读下面的程序以及注释的要求,在空格处填上相应的代码 import java.awt.*; import java.awt.event.*; import javax.swing.*; public class MyMouseHandler extends JFrame { public MyMouseHandler() { final JLabel label = new JLabel("此处显示鼠标右键点击的坐标"); label.setOpaque(true); label.setBackground(Color.PINK); this.add(label, BorderLayout.NORTH); this.setSize(300, 200); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.addMouseListener( (1) {//用内部类的方式创建一个MouseAdapter为窗体注册监听器 (2) { //重写鼠标点击事件 if (e.getButton() == e.BUTTON1) { int x = e.getX(); int y = (3) //获得鼠标的纵坐标 String banner = "鼠标当前点击位置的坐标是" + x + "," + y; (4) // 在JLabel标签中显示banner的信息 } } }); this.setVisible(true); } public static void main(String[] args) { new MyMouseHandler(); } }