I agree with Bob that a state variable is the way to go.  But instead of
threads, I'd suggest diffing the time between clicks.  If the difference is
less than 500ms (or some user-defined time), then it's a double-click.

<rant>
And, Ashish, please come up with a more informative subject line
</rant>

----- Original Message -----
From: "Bob Dengle" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 31, 2001 8:15 PM
Subject: Re: [JAVA3D] plz Explain!


> Hi
>
> One thing you could do would be to set a flag and then tell the thread to
> wait for a certain length of time. Meanwhile, another thread waits to see
if
> there is another click. If there is another click in that time interval,
it
> removes the flag and notifys the first thread. The first thread checks the
> flag, and depending on the number of clicks executes your 1-click or
2-click
> action.
> This would result in a small hang time between one click and the response.
> If anyone else has a better suggestion i would be glad to hear it, as im a
> bit rusty on thread scheduling :-(.
>
> B.D.
>
>
> >From: Ashish Aggarwal <[EMAIL PROTECTED]>
> >Reply-To: Discussion list for Java 3D API <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: [JAVA3D] plz Explain!
> >Date: Tue, 31 Jul 2001 18:44:52 -0700
> >
> >hello Dan!
> >
> >I am executing events at both  getClickCount==1 and
> >getClickCount==2. If i had nothing to do at 1, then
> >there was no problem. Actually at 1, i am drawing
> >lines betwen primitives and at two, I want to remove
> >lines between primitives. So, plz explain me. Its
> >really urgent.
> >
> >thnaks
> >
> >
> >
> >--- Dan Boorstein <[EMAIL PROTECTED]> wrote:
> > > >
> > > > From: Ashish Aggarwal <[EMAIL PROTECTED]>
> > > > Date: 2001/07/31 Tue PM 01:30:47 EDT
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [JAVA3D] plz Explain!
> > > >
> > > > Hello!
> > > >
> > > > How to differentiate between single click of the
> > > mouse
> > > > and double click.i am using:
> > > >
> > > > event.getClickCount() to find out the number of
> > > > clicks.
> > > > The problem is that, when I double click the
> > > mouse, it
> > > > executes the code for:
> > > >
> > > > event.getClickCount()=1, before executing code
> > > for:
> > > >
> > > > event.getClickCount()=2
> > > >
> > > > I don't want  event.getClickCount()=1 to take
> > > place
> > > > when i am double clicking the mouse. Please reply
> > > as I
> > > > am stuck for last three days. Hope to get a reply
> > > > soon.
> > > >
> > >
> > > Maybe I don't understand your problem correctly, but
> > > couldn't you just not do anything when
> > > getClickCount==1?
> > > At the top of your event handler, just return if
> > > it's not
> > > 2, otherwise, continue processing.
> > >
> > > - danboo
> > >
> > >
>
>===========================================================================
> > > To unsubscribe, send email to [EMAIL PROTECTED]
> > > and include in the body
> > > of the message "signoff JAVA3D-INTEREST".  For
> > > general help, send email to
> > > [EMAIL PROTECTED] and include in the body of the
> > > message "help".
> >
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Make international calls for as low as $.04/minute with Yahoo! Messenger
> >http://phonecard.yahoo.com/
> >
>
>===========================================================================
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> >of the message "signoff JAVA3D-INTEREST".  For general help, send email
to
> >[EMAIL PROTECTED] and include in the body of the message "help".
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff JAVA3D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to