• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTree can TransferHandler & DnD Listeners coexist ?

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

Has anyone tried to add TransferHandler for JTree which implements DnD Listeners too.

I implement DnD behaviors using DnD listeners. I want to support a feature where in user can drag and drop a file/directory from outside the JVM. in such cases I'm getting the following exception:

This thing has been traced to
sun bug 4378091 .
I have java 1.4 even though this bug is fixed in Tiger. I tried all workarounds prescribed

I would dearly appreciate any suggestions/workarounds

TIA
 
Ravi Sathish
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem atleast in my case that I had missed acceptDrop() call. hope it may useful to somebody searching for this kind of functionality.

So bottom line for JTree

Go for TransferHandler if you need basic functionality with default Drag & Drop behaviors;

Implement DragGestureListener,DragSourceListener,DropTargetListener if you need better control & functionality especially viz. drag & drop

Anyways the code to handle file drop:

[ August 09, 2005: Message edited by: Ravi Sathish ]
reply
    Bookmark Topic Watch Topic
  • New Topic