🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #7895

Re: JButton in a drag-and-drop operation

#7895
From: Philippe Trottier
Date: Thu, 07 Dec 2000 00:00
49 lines
2757 bytes
I'm sorry, I wasn't clear.

I am using a MouseListener to listen to click events on the button (method
mouseClicked()). Most of the time, even if the user tried to perform a
double-click, the click count of my MouseEvent has a value of one (1).
So basically, my listener is invoked because a click event was caught but
instead of being an event with a click count of 2, the click count is 1.
Therefore, most of the time a user tries to double click, the action is
interpreted as a single click. I thought that might have been because of the
delay accepted between 2 clicks of a mouse but even if I shorten the delay,
the same problem still occurs.

So basically, the user tries to double click on a button. My
MouseListener::mouseClicked(MouseEvent e) method is invoked but the click
count returned by e.getClickCount() is equal to 1 and not 2. Sometimes
though after clicking on the button continuously for a few seconds, the
click count will be equal to 2 and the expected behavior will be met.

Hope this clears it up and thank you for your support,

Philippe T.

"John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message
news:MPG.148fd4a3e488df989d74@forums.borland.com...
> On Mon, 27 Nov 2000 10:48:51 -0500, Philippe Trottier wrote:
>
> > What i meant by the double-click is ignored is that whenever
> > the user double-clicks on one of my DnDButtons, the only
> > event reported is a single-click event. It's as though the
> > single-click event takes precedence over the double-click.
>
> What do you mean by "reported"?  Do you mean your listener is notified?
>
> Try adding this method to your button class.  You should see each event
> that the button receives.
>
>     protected void processEvent( AWTEvent event ) {
>         System.out.println( event );
>         super.processEvent( event );
>     }
>
> --
> Regards,
>
> John McGrath [TeamB]
>
> ---------------------------------------------------
> Before sending me e-mail, please read:
>     http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <3a2ff0c5_2@dnews>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3a1d7ca4$1_2@dnews> <MPG.148aba4544665989d62@forums.borland.com> <3a228269$1_2@dnews> <MPG.148fd4a3e488df989d74@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,9e92e48dd1c15db7
X-Google-Attributes: gid111d45,public
From: "Philippe Trottier" <philippe.trottier@simplernetworks.com>
Subject: Re: JButton in a drag-and-drop operation
Date: 2000/12/07
Message-ID: <3a2ff0c5_2@dnews>
X-Deja-AN: 702296586
References: <3a1d7ca4$1_2@dnews> <MPG.148aba4544665989d62@forums.borland.com> <3a228269$1_2@dnews> <MPG.148fd4a3e488df989d74@forums.borland.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
X-Trace: 7 Dec 2000 12:19:17 -0800, 216.191.3.122
Organization: Simpler Networks Inc.
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.swing