craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > QuickTable Installation Issues Post New Topic   Post A Reply
Drag and Drop printer friendly version
next newest post | next oldest post
Author Messages
danlamb{@}starband.net
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

Hello Ben,

I have a frame with a JTree on one side and a dbtable on the other. I would like to drag dbtable rows and drop them on the JTree (and possbily other swing components like JTextArea and JList). I've done this already with the JTree on one side and a JList on the other, but I'd really like to use a dbtable instead of a JList. Does dbtable support drag and drop in any way?

Thanks,
Daniel Lamb

admin{@}quicktable.org
Unregistered
Edit or delete this message Reply w/Quote
Posted Wednesday, December 31, 1969 @ 23:59:59  

Daniel,

Quicktable doesn't support drag & drop. But you can always get the JTable instance from quickTable (using dbTable.getTable() ) and then create an appropriate java.awt.dnd.DragSource , java.awt.dnd.DragGestureRecognizer , java.awt.dnd.DragGestureListener , java.awt.datatransfer.Transferable, java.awt.dnd.DragSourceListener classes. When the user drags the record from DBtable into JTree, find the record using rowAtPoint() method of Jtable, delete the record using delete method ( if you don't set delete sql, the record won't be deleted from database, but the record will be deleted in dbTable) an then add this to JTree. If the user tries to drag the record into dbTable, find the row where use is trying to insert using the rowAtPoint method of JTable, then call the insertAt() method.

have a look at the following tutorial about how to implement darg & drop for JTable

http://www.javaworld.com/javaworld/jw-08-1999/jw-08-draganddrop.html

http://www.jguru.com/faq/view.jsp?EID=409515

Since each user applications want to do drag & drop in different way, it is not possible to create a common drag & drop mechanism for quickTable. In future we will try add a basic drag & drop feature.

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios