This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / java problem
-oldsix(oldsix);
2000-10-23
{774}
(#11686@0)
-
You can click on a Button (ActionEvent). And You can move your mouse on a Container such as Panel (Applet is a kind of Panel), Frame, Window.Dear OldSix,
Moving a mouse on a Button is not a meaning event. So you should not add
a MouseMotionListener to the Jbutton.
Instead, you should add an ActionListener.
For a Container such as Applet, you can add a MouseMotionListener.
Hope it helps you.
-jabber(jabber);
2000-10-23
{268}
(#11746@0)
-
hi,jabber,i am wondered...certianly,it's just for test.but i am wonder now,
in JDK document ,the JButton has the method inherited from Component, so it should be useful to JButton. that's the question is:
1.How to use the inherited method?
Is there any other rule in using the inherited method?
by the way,i define the class implement the mousemotionlistener, in there,i add the line:
addMouseMotionListener(JButton.this);
then you can hold the mouse motion event by the reference of JButton.
-oldsix(oldsix);
2000-10-24
{482}
(#11841@0)