JTree Drop Target Highlighting while dragging

Hi All,
I am having this requirement where I need to develop a similar interface as that of the Windows Explorer. I am facing problems in the JTree where one of the requirements say that I need to be able to highlight(select) a node when it is dragged upon although that might not be the drop target, very similar to Windows Explorer where while dragging a folder, even before dropping the folder on a target folder the drag selects all the nodes over which the drag moves.
Also I need to be able to get a ghost image of the item being dragged, very similar to that of Windows explorer.
If anybody out there knows how to achieve this Please help.
Regards,
Kumar GHH

In the dragGestureRecognized (DragGestureEvent dge) method I am trying to set the cursor from default drag cursor to move cursor. But the move cursor is showing along with the default cursor with flickering. While dragging the image I just want to show the move cursor only.

Similar Messages

  • My drag images disappear when they are dropped on a correct drop target during the drag and drop interaction.

    What am I missing. The opacity is at 100%. The drop target is a highlighted box from objects. I am using Captivate 8.

    Hi there,
    You might want to make sure your Depth setting is not set to Back instead of Front on your drop target(s).
    The Depth setting is accessed via the Drag and Drop window/panel under Format setting while you have your drop target selected.
    If your Depth setting is set to Back, especially if your opacity is set to 100% on your highlight box/drop target, your drag image would go behind your drop target giving the effect of disappearing behind your highlight box - especially if the drop target is larger than the drag image.

  • Display JTree Node as image  while Drag And Drop

    HI all.
    I have multiple 5 JTrees which involve drag and drop to each other . I would like to display the node(JCompenent) as image/cursor which a DnD operation .So that user could see what he drags .
    I tried out the example about ghost image .
    http://www.javaworld.com/javaworld/javatips/jw-javatip114.html
    This works fine ,but when i apply the same concepts to my application it doesnt work .
    Could any one suggest what could be problem.
    Cheers,Baiju

    I also need to drag my node on my scene during a "drag and drop" operation. But i can't find a solution.
    I've tried to use "startFullDrag()" and catch MouseDragEvent, but nothing ...
    Can anyone help me ?
    Thank !

  • Drop Target Registration

    I am using DnD to drag items from a JTree (drag source) onto another JTree (drop target). This all takes place within a JPanel enclosing a JSplitPane. It works fine when I run this class using a main(), creating a JFrame within the main() and adding the DnD JPanel. When I add this component into the application the Drop Target doesn't seem to get registered. I can't get any of the methods in the DropTargetListener I/F to fire. As a result, invoking the getDropSuccess() method on the DragSourceDropEvent object in the dragDropEnd() method of the my DragSourceListener always returns false.
    The new DropTarget(component, myDropTargetListener) call returns a non-null object so I assume it's getting registered. Help!!

    This problem was introduced by the IDE. VisualAge prohibits applications from registering DropTargetListeners in the context of a large application.
    kduell@altawave

  • How to get source and target components in Drag'n'Drop

    I have a JList that is a drag source and a drop target, when an item is dragged form the list I only want a drop to be allowed in another component (ie a JTree). I dont want to allow the drop to be allowed on the list. In other words I need a way of saying, if (dragSource!=dropTarget), then allow drop.
    There doesn't seem to be an easy way to do this though, any ideas?
    Your help would be greatly appreciated.

    Sagarika,
    Please go thru the dev guide which explains the train flow in the multistep update exercise. Compare the steps with ur implementation.
    - Senthil

  • Drag and Drop Interaction with 50+ Drop Targets

    Hello,
    I'm fairly new to Captivate 7 but very familiar with Flash. I'm tasked with a project that I would like to do with the drag and drop interaction widget from Captivate 7. Basically, we need our learners to identify the locations of our resorts on a map. Select the name of the resort, drag and drop it in the city/state or country where located. My question is can Captivate handle this task? To me, it seems as a large task for Captivate to handle, and so I was thinking of coding it in Flash.
    Here is what I need:
    1.- List of all the properties at bottom with the drop target being a map of the US or world and have the location for each property as the drop target.
    2.- When the resort/property is selected, the name will change to the three letter code. Example: New York City, when clicked = NYC and the map itself to reflect the 3 letter code once dropped on the map if correct.
    3. If incorrect, the listed item will revert to the long name and return to the list.
    4. If this can be graded, it would be best.
    I can break the project into different regions but if I wanted to keep all 300+ properties in one module, will it be an issue? At the very least, I would need to do a minimum of about 50 per module.
    Thanks all! I've found this forum to be extremely helpful and the members seem to be eager to help.

    var matchingTargetName:String =(event.target.name).substring(0, 1);
    Change the name of the target to A and B and the mc A1, A2, A3, A4... and B1, B2,B3...

  • 1 Success Caption for Multiple Targets in a Drag and Drop Interaction

    I see how I can add success captions to each target in a drag and drop interaction, but can you apply only 1 success caption multiple targets?

    The boundaries of smartshapes were overlapping with each other. For example, the smartshape on 1st line was overlapping with the one on 2nd line. Due to this, every time you place the text caption "Investment" on the smartshape on 2nd line, it automatically moved to the smartshape on 1st line. As a result, you could never get the answer right, and hence you never saw the Success Caption.
    Solution: Move the smartshapes away from each other (or resize them), and ensure that there are no overlaps.
    2,  The number of attempts for this interaction was set to Infinite. So, you have to play this until you get it right, but you could not get it right because of the reasons mention above. That is why you never saw the Failure Caption.
    Solution: Clear the Infinite check box in the Action accordion and specify the required number of attempts. You will get the Failure Caption if you don't get it right in those attempts.
    I just tested these solutions and they worked fine. Let me know if you still face any issues.

  • Flex 4.6 Drag and Drop: an event that fires when dropped on invalid drop target?

    Is there an event or condition somewhere in the DragManager to differentiate between an item that is eitther dropped on an invalid  or a valid drop target?
    I need to re-populate data to the original container after the drop has occured, however i can't seem to find any event or condition that would indicate if the dragged item was dropped on a valid or invalid target? Thanks in advance.

    Older machine = Windows XP
    Newer = Windows Vista

  • How do I make drag sources disappear after being moved to the correct drop target in Captivate 7

    How do I make drag sources disappear after being moved to the correct drop target in Captivate 7

    Thank you so much. I could have searched a very long time and not found that. It is counter-intuitive to me that I would set the behavior for the drag source on the properties for the drop target.

  • Specify multiple correct targets in a drag and drop?

    Is it possible to specify more than one correct target in a drag and drop interaction (i am creating a quiz where the learner has to label a diagram of the urinary system and there are 2 kidney labels they have to correctly drop onto the diagram, however i would like either label to be correct if dragged onto the 2 kidneys - if i've explained this clearly?)

    Sorry, overlooked this question. Lot can be solved from that window, glad you found out yourself.

  • Close folders while drag-and-dropping files?

    When dragging files to move them, often some large folders will be open, which means I have to drag/scroll thru the file list to get to other folders. Is there a way to close folders while dragging files?

    EMichaelM wrote:
    I just installed two widgets that are supposed to function by dragging and dropping files into them. How do I get access to files? How do you get files from the Finder into the dashboard?
    You need to activate Dashboard's "Developer Mode" in order to keep widgets active on the desktop.
    Open Terminal and enter the following command:
    <PRE>
    defaults write com.apple.dashboard devmode YES
    </PRE>
    Close Terminal, log out of your user account, and log back in again. To move a widget onto your desktop, activate Dashboard and start dragging the widget to the desktop. Press F12 before letting up on the mouse button to close Dashboard, and the widget should now be permanently affixed to the desktop. Drag to your desired location.
    Steve

  • Drag n drop exception - drop target listener

    It seems several people are having a problem with the built in drop target listener. See the (second part of) thread linked below (was mistakenly put in AWT forum).
    http://forum.java.sun.com/thread.jspa?messageID=2905780&
    ANY help would be much appreciated.

    Can anyone please help with this? No one seems to understand it. I get the following exception when dragging outside of a JTable:
    java.lang.NullPointerException
         at javax.swing.plaf.basic.BasicTableUI$TableDropTargetListener.restoreComponentState(BasicTableUI.java:1216)
         at javax.swing.plaf.basic.BasicDropTargetListener.dragExit(BasicDropTargetListener.java:249)
         at javax.swing.TransferHandler$SwingDropTarget.dragExit(TransferHandler.java:586)
         at sun.awt.dnd.SunDropTargetContextPeer.processExitMessage(SunDropTargetContextPeer.java:385)
         at sun.awt.dnd.SunDropTargetContextPeer.access$700(SunDropTargetContextPeer.java:52)
         at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchExitEvent(SunDropTargetContextPeer.java:792)
         at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:740)
         at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:29)
         at java.awt.Component.dispatchEventImpl(Component.java:3494)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:3315)
         at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:3261)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3123)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    I get similar exception when dragging within a JList (except the NPE is in BasicTableUI$TableDropTargetListener.updateInsertionLocation). I'm using the provided StringSelection as my Transferable. The exceptions disappear when I disable the look and feel options in my app.
    PLEASE HELP. I'm so confused/frustrated by this.
    THANK YOU in advance.

  • Keyboard shortcuts while dragging-and-dropping?

    In Windows, when I'm dragging and dropping files from one folder to another, I can press keys on the keyboard to force it to change its behaviour -- for example, if I hold the Crtl key down, it will force it to copy files instead of move them.  Similarly, I can hold down the shift key to force it to move files when it wants to default to copying them.
    What is the equivalent keypress on a Mac running OS X 10.9.2?  It keeps moving files when I want to copy them (and vice-versa) and I just can't figure out which key(s) to press while dragging-and-dropping to make it change its behaviour.
    Thanks for your help,
    Laurence MacNeill
    Mableton, Georgia, USA

    Press the Option key to force a copy, or the Command key to force a move. Pressing both at once will create an alias.
    (103123)

  • SecurityException while drag and drop ??

    hi group,
    i am getting security Exception while drag and drop.
    Any body can find this bug...
    Exception occurred during event dispatching:
    java.security.AccessControlException: access denied (java.awt.AWTPermission acceptDropBetweenAccessControllerContexts)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at sun.awt.windows.WDropTargetContextPeer.getJVMLocalSourceTransferable(Unknown Source)
    at sun.awt.windows.WDropTargetContextPeer.processEnterMessage(Unknown Source)
    at sun.awt.windows.WDropTargetContextPeer.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.Dialog.show(Unknown Source)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    thank u..

    hi,
    your problem might be due to any of the following
    1. No java 2 plugin - install it.
    2.drag & drop between AWT & Swing Frames(windows)
    3. Add the following text to your java.policy file and restart your computer.
    grant {
    permission java.awt.AWTPermission "accessEventQueue";
    permission java.awt.AWTPermission "setDropTarget";
    permission java.awt.AWTPermission "accessClipboard";
    permission java.awt.AWTPermission "acceptDropBetweenAccessControllerContexts";
    permission java.awt.AWTPermission "listenToAllAWTEvents";
    please let me know if this works.
    good luck

  • Image as drop target for drag and drop

    was wondering how I can make an image to be a drop target using the dnd api. so far from what i've seen it takes only java components to be target, so if anyone has any ideas it will be great.
    thanks

    I don't know why your DropTarget implementation doesn't work, but an alternative, more high-level way of doing what you want is to use a TransferHandler:
            canvas.setTransferHandler(new TransferHandler() {
                @Override
                public boolean canImport(TransferSupport support) {
                    if (support.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                        support.setDropAction(DnDConstants.ACTION_COPY);
                        return true;
                    return false;
                @Override
                public boolean importData(TransferSupport support) {
                    try {
                        String text = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
                        System.out.println(text);
                        return true;
                    catch (Exception ex) {
                        ex.printStackTrace();
                        return false;
            });

Maybe you are looking for

  • TV shows no longer sync

    Ok, this is something that just came up. TV shows that I could once sync to my ATV will no longer sync. I don't even get an error in iTunes about why they are not syncing. I did a full factory reset of the ATV (which brings it back to verions 1.0) an

  • GPS in Ethiopa

    Hello -- I'm an American living in Ethiopa. I've just ordered a Lumia 710 and joined this group. Does Lumia have any GPS support in Ethiopia?

  • Does running Photoshop CS5 and CS6 cause problems with plugins?

    I have Phootshop CS5 (32 bit) and have also installed CS6 (64 bit) on the same PC.  After installing CS6, and reinstalling the plugins, many plugins do not run on CS but continue to work on CS5?  In some cases (Topaz for example), some filters load a

  • Sales order stock order picks up purchase agreement by default

    Hi, When we create sales order stock, if the article has an agreement like a contract with the vendor, the agreement number comes by default in the pur. requisition data in the sales order. Due to this when PO is created wrt this pur requisition, the

  • Cannot find a J2SE SDK installed at path...

    I posted this in the SQL-Deveolper forum, but perhaps it is better posted here, since it is a Java issue. I found a thread for this same problem from 2007, but did not find an answer for it. I'm installing sql-developer on a Windows7 machine 64bit. W