什么都没学到,记录一个鼠标监听事件吧

textField.addMouseListener(new MouseAdapter() {         //鼠标在textField中时,改变btnNewButton的文本内容 貌似我的概念是混乱的,用控件乱用哈,哈哈
public void mousePressed(MouseEvent e) {
btnNewButton.setText("按下鼠标" );
}
@Override
public void mouseReleased(MouseEvent e) {
btnNewButton.setText("松开鼠标" );
}
@Override
public void mouseEntered(MouseEvent e) {
btnNewButton.setText("鼠标进入" );
}

posted @ 2017-10-16 01:30  637  阅读(111)  评论(0编辑  收藏  举报