Article View: borland.public.jbuilder.java.swing
Article #7912Re: JButton in a drag-and-drop operation
From: Philippe Trottier
Date: Mon, 27 Nov 2000 00:00
Date: Mon, 27 Nov 2000 00:00
48 lines
2478 bytes
2478 bytes
Thanks for the reply, 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. So basically, the double-click event is not generated, a single-click event is generated instead. Regards, Philippe Trottier "John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message news:MPG.148aba4544665989d62@forums.borland.com... > On Thu, 23 Nov 2000 15:22:52 -0500, Philippe Trottier wrote: > > > What could i do (possibly in the dragDropEnd(DragSourceDropEvent e) > > method) to set the button state back to normal? > > You might try: button.getModel.setPressed( false ); > > ButtonModel also has setters for other properties such as "Armed" and > "Rollover" > > > Also, i have a custom mouse listener on every DnDButton > > (derived from JButton see above). I listen to single clicks > > and double- clicks (getClickCount() == 2). However, most of > > the time, the double click event is ignored and results in > > a single click action. > > I do not understand -- what ignores the event? Are you saying that the > event is not generated, not delivered to your listener, not processed > properly by your listener, or maybe does not have the correct click > count? > > One way to see what is happening would be to print a message in your > listener and also add an AWTEventListener to your Toolkit and print > them out there. You could also override processMouseEvent() or > processEvent() in DnDButton and print a message there. > > -- > Regards, > > John McGrath [TeamB] > > --------------------------------------------------- > Before sending me e-mail, please read: > http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<3a228269$1_2@dnews>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3a1d7ca4$1_2@dnews> <MPG.148aba4544665989d62@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/11/27 Message-ID: <3a228269$1_2@dnews> X-Deja-AN: 698275327 References: <3a1d7ca4$1_2@dnews> <MPG.148aba4544665989d62@forums.borland.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Trace: 27 Nov 2000 07:48:57 -0800, 216.191.3.122 Organization: Simpler Networks Inc. X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing