File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Help please with drag and drop Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Help please with drag and drop" Watch "Help please with drag and drop" New topic
Author

Help please with drag and drop

Jonathan Johansen
Greenhorn

Joined: Aug 04, 2009
Posts: 8
Hello everyone, I apologize if I am not making things the right way, although I registered a long time ago this is my first post at this forum. I have a little problem here, it work almost perfect except that when I drag from bottom to top it does not do it. I put print lines and it says that it 's doing everything correctly. If you may wonder why I am doing it this way when I could be using new StringSelection(), the the reason is because I am planing to extend Vector class to create a class Row and put info in it, so when I drag I drag the whole row, because my Row class will contain Components and Objects.
Thanks in advance for your help!!!

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

Thanks for providing a short, simple, compilable example. When I run it, I find that you can't drop a row anywhere above where you are dragging it from, but you can drop it anywhere below where you are dragging it from.

All I can say is, bear in mind that when you call insertRow and deleteRow, you renumber all of the rows below the point where you inserted or deleted. You also potentially change the numbers of the selected rows.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help please with drag and drop
 
Similar Threads
Component not working at Mac M/C
DND from JTree to JTable
Pasting image in JTable cells
BufferedImage to System Clipboard
TransferHandler to dnd files from OS desktop to JTable