Results 1 to 6 of 6
Thread: Drag and Drop(URGENT)
- 07-01-2009, 01:49 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 29
- Rep Power
- 0
Drag and Drop(URGENT)
Hi,
I am implementing drag and drop on jtables.Dragging jtable1 rows and dropping to jtable2 and vice-versa.I am facing following issues.
--I need to make a check that when a row from jtable1 is dropped the operation is performed only if the drop place is jtable2 and vice-versa.
-- I am able to do multiple selections but when i drag them mutiple selections are lost.Sometimes two consecutive rows are dragged but not always.
--Also sometimes on just a single click on a row, the drag and drop operation is performed.
--My jtable implements DragGestureListener, DragSourceListener,
DropTargetListener
and
public void dragGestureRecognized(DragGestureEvent dge) {
//some code
//dge.startDrag method is then called.
}
public void dragDropEnd(DragSourceDropEvent dsde){
}
methods are implemented.
Thanks a ton in advance,
Simmi
- 07-01-2009, 06:07 PM #2
The older AWT/underlying drag_and_drop classes don't work as well with Swing components as do TransferHandlers.
Lesson: Drag and Drop and Data Transfer is a good reference.
- 07-02-2009, 07:27 AM #3
Member
- Join Date
- Apr 2009
- Posts
- 29
- Rep Power
- 0
Hi....
I am not able to figure out how to get the drop location or name of the component where the drop is made in my case jtable. I have set the name of both the tables and get the name of the source table but could not get the name of table where row is dropped.
Any help on this will be appreciated.
Thnx,
Simmi
- 07-02-2009, 05:56 PM #4
I am not able to figure out how to get the drop location or name of the component where the drop is made in my case jtable
Did you set a TransferHandler on both of the JTables?
Override the relevant TransferHandler methods and write code to get the behaviors you want. These are complex things to put together. Have you worked through the tutorial?
- 07-03-2009, 03:38 AM #5
Hardwired is correct on both counts. What you want to do is simple--once you do it the first time.
- 07-10-2009, 11:16 AM #6
Member
- Join Date
- Apr 2009
- Posts
- 29
- Rep Power
- 0
Drop Location
Hi,
I am able to across two jtables but not able to get the target Jtable.i.e.get the jtable where the mouse was when drop was done.Though i have set the dropTargetListener for both the tables yet it gets activate dfor only the first one everytime irrespective of the jtable from where drag started.
Thanks in advance..
Similar Threads
-
Drag and drop
By thayalan in forum AWT / SwingReplies: 1Last Post: 02-16-2009, 03:04 PM -
drag-drop in applet.
By makpandian in forum Java AppletsReplies: 0Last Post: 12-11-2008, 08:36 AM -
SWT DND (Drag and Drop) comprehensive Example
By Java Tip in forum SWTReplies: 0Last Post: 07-07-2008, 04:36 PM -
Drag and drop
By abhivenugopal in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 01-30-2008, 02:10 PM -
help drag and drop in JTabbedPane
By RO86 in forum AWT / SwingReplies: 0Last Post: 08-14-2007, 01:22 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks