鼠标监听
Button b1 = new Button("按钮一");
f.add(b1);
f.setLayout(new FlowLayout()); //设置布局管理器
b1.addMouseListener(new MouseAdapter() {
/*@Override
public void mouseClicked(MouseEvent e) { //单击
System.exit(0);
}*/
@Override
public void mouseReleased(MouseEvent e) { //释放
System.exit(0);
}
});