Java Timer suggestions needed

Discussion in 'Java' started by Kaish, Feb 18, 2007.

  1. Kaish

    Kaish Guest

    Hello all,

    I'm coding an application that tracks mouse movements (using
    mouseListener and mouseMotionListener). I want to be able to time how
    long a cursor remains on a certain component - for example, how long a
    user keeps his cursor over a button.

    Any suggestions on how to go about this?

    Thanks.
    Kaish, Feb 18, 2007
    #1
    1. Advertising

  2. Kaish wrote:
    > Hello all,
    >
    > I'm coding an application that tracks mouse movements (using
    > mouseListener and mouseMotionListener). I want to be able to time how
    > long a cursor remains on a certain component - for example, how long a
    > user keeps his cursor over a button.
    >
    > Any suggestions on how to go about this?
    >
    > Thanks.
    >


    Sure. There is a MouseEvent generated every time you enter and exit a
    component with the mouse. Write a MouseListener that records the time
    on enter and subtract that from the time on exit.

    --

    Knute Johnson
    email s/nospam/knute/
    Knute Johnson, Feb 18, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kelsang Wangchuk

    System.Timers.Timer vs. System.Threading.Timer

    Kelsang Wangchuk, Jul 31, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    703
    Kelsang Wangchuk
    Jul 31, 2003
  2. Replies:
    1
    Views:
    1,576
    Steve C. Orr [MVP, MCSD]
    Feb 22, 2005
  3. Simon

    page timer, or redirect timer

    Simon, Nov 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    11,183
    Bruce Barker
    Nov 4, 2005
  4. amy j
    Replies:
    4
    Views:
    870
    Alex Hunsley
    Oct 13, 2004
  5. Replies:
    8
    Views:
    477
    Jorgen Grahn
    Jul 15, 2013
Loading...

Share This Page