It seems that your concept is not quite clear here

jabber (jabber)
1. The following toy code is OK:

public class XXX extends JPanel implements MouseMotionListener{

JButton jButton = new jButton("Test");
jButton.addMouseMotionListener(this);

public void mouseDrapped(MouseEvent e){
//Do this
}
public void mouseMoved9MouseEvent e){
//Do that
}

}
Comments: "JButton.this" is at least a poor syntax.

2. In Java gragramming, it is a common practice to have a Container be an EventListener. But it is not a good idea to let Button or JButton be a listener. Academically, it is OK.
(#11891@0)
2000-10-24 -05:00

回到话题: java problem

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=11891