java help

Discussion in 'Mac Programming' started by fivetoadsloth, Dec 4, 2006.

  1. fivetoadsloth macrumors 65816

    fivetoadsloth

    Joined:
    Aug 15, 2006
    #1
    im trying to write a little app in java is there a way to tell it to check the mouse coordinates now and than agin in foour miuntes and if they have display a pop up message, and if they havnt do nothing?
    thanks alot
     
  2. fivetoadsloth thread starter macrumors 65816

    fivetoadsloth

    Joined:
    Aug 15, 2006
    #2
    well i asked a friend and he said that this is alot harder than i though and he didnt know. Sorry, but if youd have any ideas, or even better, know how! could you tell me? thanks.
     
  3. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #3
    You should probably create a window containing a Swing component, such as JPanel, and get the coordinates from it.
     
  4. bozigle macrumors regular

    #4
    MouseXXListener

    I'm not sure that for your purpose you really needs to know the coordinates. what you need is to know if your mouse did something.
    You should probably use a timer thread(not doing much more than counting your 4mins, reseting and poping up your window) and on your main thread you implement the MouseMotionListener and MouseListener (maybe also ActionListener and friends) and reset your timer in the first line of those methods...

    bozigle
     

Share This Page