Article View: borland.public.jbuilder.java.swing
Article #7902Re: JButton in a drag-and-drop operation
From: John McGrath TeamB
Date: Sun, 26 Nov 2000 00:00
Date: Sun, 26 Nov 2000 00:00
34 lines
1741 bytes
1741 bytes
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:
<MPG.148aba4544665989d62@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3a1d7ca4$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,9e92e48dd1c15db7 X-Google-Attributes: gid111d45,public From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Subject: Re: JButton in a drag-and-drop operation Date: 2000/11/26 Message-ID: <MPG.148aba4544665989d62@forums.borland.com> X-Deja-AN: 697852396 References: <3a1d7ca4$1_2@dnews> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing