X-Received: by 10.180.100.167 with SMTP id ez7mr4605021wib.0.1370902452124; Mon, 10 Jun 2013 15:14:12 -0700 (PDT) X-Received: by 10.50.141.225 with SMTP id rr1mr1268905igb.17.1370902451871; Mon, 10 Jun 2013 15:14:11 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.212.215.MISMATCH!lg1no15587861wic.0!news-out.google.com!hv6ni12796wib.1!nntp.google.com!ch1no3456651qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.gui Date: Mon, 10 Jun 2013 15:14:11 -0700 (PDT) In-Reply-To: <83dd7dc7-c9d4-41b2-ada2-be50758aecf3@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T NNTP-Posting-Host: 69.28.149.29 References: <83dd7dc7-c9d4-41b2-ada2-be50758aecf3@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <534db8a1-6fb0-47a4-a532-30e4bbbf0495@googlegroups.com> Subject: Re: TransferHandler exportAsDone called before exportAsDrag returns From: Lew Injection-Date: Mon, 10 Jun 2013 22:14:11 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.gui:5359 FredK wrote: > I have a subclass of JPanel for which I am trying to implement > drag-and-drop. I add a mouse listener to the component, and in > its mousePressed() method I call > JComponent c = (JComponent)event.getSource(); > TransferHandler th = c.getTransferHandler(); > th.exportAsDrag( comp, event, TransferHandler.COPY ); > > The problem is that the handler's exportAsDone() method is > called immediately - before exportAsDrag() returns, and > before the mouse is moved or released. Can you provide an SSCCE? http://sscce.org/ The problem appears to be in the part of the code you haven't shown us. Are you managing events on the EDT properly? -- Lew