Computer Science Canada mouse click |
Author: | tenniscrazy [ Fri Jun 06, 2008 9:21 am ] | ||
Post subject: | mouse click | ||
hey I'm trying to use getButton to see whether the mouse is clicked down. If i add it in where i get the mouse position, it seems to work, but whenever i try to use the variable, it says it expects something else.
I'm wondering what kind of variable i'm supposed to use for click. on the class libraries one page says it outputs a variable and another page says it outputs a constant. could someone please help me get this working, thanks |
Author: | HellblazerX [ Fri Jun 06, 2008 12:41 pm ] |
Post subject: | Re: mouse click |
You're going to have use the MouseListener interface as well, as it includes the method for mouse clicking. |
Author: | tenniscrazy [ Sat Jun 07, 2008 10:09 pm ] |
Post subject: | Re: mouse click |
Quote: You're going to have use the MouseListener interface as well, as it includes the method for mouse clicking.
i tried for a couple hours to get this working. could someone explain how to do this |
Author: | tenniscrazy [ Tue Jun 10, 2008 8:13 am ] |
Post subject: | RE:mouse click |
can someone please help me my project is due tommorow. Just explain how to see if the mouse has been clicked |
Author: | jeffgreco13 [ Tue Jun 10, 2008 8:32 am ] | ||
Post subject: | Re: mouse click | ||
Then you need to addMouseListener(); to your object. You have to implement this... check Java MouseListener at this site HERE I hate to be painfully obvious but the documentation and even examples are everywhere for you to see. |
Author: | tenniscrazy [ Tue Jun 10, 2008 2:03 pm ] |
Post subject: | RE:mouse click |
thank you I know this is probably very basic and obvious, but i'm still not used to most things in java |