Drag and Drop woes driving me up a creek!

Hello:
I went the the following link and downloaded the many samples for DnD.
http://www.rockhoppertech.com/dndsrc-beta-1.0.jar
My problem is that I do not know how to run any of the samples.
Can someone please, please, please tell me how to run even one
of the examples with step-by-step instructions? I have already
tried putting the jar and the entire directory path in my
classpath statement, and I am bombarded with import errors.
Thanks!

Can someone please help? Attached is a piece of code I am trying to modify so that I can drag and drop objects. However, the compiler gives me an error for the container.add(obj) line. Any suggestions/solutions? Thanks so much!
import java.awt.*;
import java.awt.event.*;
import java.awt.datatransfer.*;
import java.io.*;
import javax.swing.*;
public class ObjTransfer extends TransferHandler
implements Transferable {
private static final DataFlavor flavors[] = {null};
static {       
try { flavors[0] = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType); }
catch (Exception ex) { ex.printStackTrace(); }
private Object obj;
public int getSourceActions(JComponent c) { return TransferHandler.COPY;  }
public boolean canImport(JComponent comp, DataFlavor flavor[]) {
if (!(comp instanceof Object)) {
return false;
for (int i=0, n=flavor.length; i<n; i++) {
if (flavor.equals(flavors[0])) {
return true;
return false;
public Transferable createTransferable(JComponent comp) {
obj = null;
obj = (Object)comp;
return this;
public boolean importData(JComponent comp, Transferable t) {
try {
if (t.isDataFlavorSupported(flavors[0])) {
obj = (Object)t.getTransferData(flavors[0]);
if (comp instanceof Object) {
Container container = (Container)comp;
container.add(obj);
return true;
} catch (UnsupportedFlavorException ignored) { }
catch (IOException ignored) {}
return false;
//Transferable
public Object getTransferData(DataFlavor flavor) {
if (isDataFlavorSupported(flavor)) {  return obj;   }
else return null;
public DataFlavor[] getTransferDataFlavors() {  return flavors;  }
public boolean isDataFlavorSupported(DataFlavor flavor) {
return flavor.equals(flavors[0]);
} // end of ObjTransfer class

Similar Messages

  • Track pad extremely sensitive in drag and drop and clicking

    Please help with a pad that's driving me nutz! Over sensitive in underlining, drag and drop and clicking. Is there any way to control sensitivity or do I have to take it to the Apple Store?
    Thanks!

    Hello there, salvarez1957.
    The following two Knowledge Base articles offer up some great steps for troubleshooting issues with trackpads:
    Portables and Magic Trackpad: Jumpy or erratic trackpad operation
    http://support.apple.com/kb/TS1449
    and
    Intel-based Mac notebooks: Troubleshooting unresponsive trackpad issues
    http://support.apple.com/kb/TS1248
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Can't Drag and Drop in iTunes 10!

    This was driving me crazy! You can't move tracks within a playlist or drag and drop content from iTunes to your iPod.
    I hope that Apple will fix this soon! Until Apple fixes this, your best bet is to download iTunes 9. I did, and all my drag
    and drop functionality is back.
    Downloaded it here: iTunes9.dmg

    I'm having the same problem, I can't drag and drop anything to or from anywhere in iTunes. 
    I've also found a workaround.  It's a PITA, and a kludge, but it works every time.  The problem is, it only works for one item or multiple items in a single folder at a time.
    if you right click on the song, and select "Show in Finder", you can drag the raw file from the finder window into your ipod/ipad and into playlists.

  • Drag and Drop not working when Firefox is open

    I kept running into the problem and could not figure out why sometimes i could drag and drop and sometimes i could not.
    I just did some experimenting and found that as long as Firefox is minimized, drag and drop works fine.
    So the application can be open but all the windows need to be minimized.
    here is my firefox info Mozilla/5.0 Firefox/3.0.13

    I am having the same problem glasnostic you are not imagining things.
    I usually have finder set to detailed view mode and intermittently and seemingly randomly drag and drop will not work. I will be moving specific files from folder a to b then, all of a sudden, I click on a file like i did the last 10 and it wont budge. I found that like glasnostic switching to thumbnail view sometimes makes it work immediately. Otherwise just waiting a minute or two and trying again makes it work. This is so bizarre and is driving me crazy.
    I have experienced the same problem while attempting to drag files from finder into itunes.
    It happens to me without firefox open or running.
    The most recent time this happened I had open the following:
    -itunes (8.2.1)
    -Transmission (1.73)
    -ichat (4.08)
    -Safari (4.03)
    -Last.fm (1.542)
    on osx 10.5.8
    I'm using the logitech g5 mouse.

  • Drag and drop objects on swf (AS2)

    Hi! This is really driving me crazy.
    I'm trying to create a mind mapping online app for thinking maps. See here for an example of thinking maps.
    I want to let users create textfields during runtime and drag and drop them. I managed to do this using createTextField and eventListener.
    I also want to let users insert a shape (let's say a brace) to the swf and drag them around and resize them using handlers.
    Thing is:
    1) I can't click and drag a shape whenever textfields are inserted into the swf. On the stage, wherever I click and drag, one of the textfields is sure to move! And the shape does not move! (I put the shape in a movie clip and tried hitTest & put a button behind it).
    2) For a particular shape, I want to be able to drag  and resize it. To resize, i use _height property or _xscale/_yscale. When i get to resize the shape, i cannot drag it. When I can drag it, I can't resize it.
    Sigh.

    Hi! This is really driving me crazy.
    I'm trying to create a mind mapping online app for thinking maps. See here for an example of thinking maps.
    I want to let users create textfields during runtime and drag and drop them. I managed to do this using createTextField and eventListener.
    I also want to let users insert a shape (let's say a brace) to the swf and drag them around and resize them using handlers.
    Thing is:
    1) I can't click and drag a shape whenever textfields are inserted into the swf. On the stage, wherever I click and drag, one of the textfields is sure to move! And the shape does not move! (I put the shape in a movie clip and tried hitTest & put a button behind it).
    2) For a particular shape, I want to be able to drag  and resize it. To resize, i use _height property or _xscale/_yscale. When i get to resize the shape, i cannot drag it. When I can drag it, I can't resize it.
    Sigh.

  • I download firefox 5.0 and now I'm having trouble dragging and dropping PDF files into Google Docs and I can't view the PDF once uploaded. I had no problems with this in the previous verion of Firefox

    With firefox 5.0 I can't drag and drop pdf files in the google docs screen. When I do eventually get a pdf file uploaded I can't view it. I get "no preview available". In my previous verion of firefox (4.something) I had no problems with this and I was able to drag and drop and after uploaded I could view the entire file.

    Thanks one again. I know you helped me the last to. I do have the Deja Vu font set in my folder. I downloaded and the last time. So I don't know if there is supposed to be more or not, but those were installed with Windows-XP after my reformat.
    This is really driving me nuts. as I've done several re-formats on my computer and several friends computers and even upgraded hardware so I am not necessarily a software or programming expert, I am somewhat advanced when it comes to computers in general and can usually diagnose the problem but these font's are the problem and they never were before.
    I did see in another forum that if you had a Dell Computer and did the Microsoft update for the onboard video card driver that it could be the culprit, but I have that disabled being I have a much better graphics card so the updates from Microsoft for the onboard video weren't installed.
    It' a Dell Dimension 3000 with an Intel(R) 82865G Graphics Controller so I don't believe it is the culprit being it is disabled. The actual video card that I am using is a PCI Nvidia GeForce 9400 GT with 1 GB Memory. And I didn't have any problem before.
    I appreciate the help. But still can't get things to work. Live Help Chat doesn't open for another two hours so maybe they can do "Remote Access" or something and can check setting and help me. But if you come up with other suggestions, they would be greatly appreciated.
    Thanks again.
    Susan

  • Widget won't drag and drop accross

    Hi there
    I am so sorry, I'm a complete beginner here. I am doing the tutorial's but for some reason my color sample in the library won't drag across.  Seems like the simplest thing in the world, but I just can't make it work.  What silly thing am I doing wrong? I'm working on Windows 7.  Thanks in advance!

    Thanks for replying Brad. In the Muse tutorials for Katies Cafe, there are some things you download straight into your library... a colour sample, a contact form, social icons etc.  You're then supposed to drag them onto the page you're building  Try as I might this will not work (I'm following the tutorial step by step).
    If I go into the widget library where the forms etc are those things drag and drop across fine. It's driving me crazy.  I've reloaded the files into Muse, restarted my computer, all that stuff.  I'm stuck, and need to learn this programme for a client of mine.
    Any thoughts?

  • Multiple Item Drag and Drop

    I'm working on an application where I need multiple item DnD between JTrees and JTables. I'm using Java 1.4.1
    I have the basics of multiple item DnD working, by creating Transferable classes that contain a collection of items.
    The problem I have is when I drag a multiple selection within a JTree (i.e. DragSource and DropTarget are the same) then my call to event.getCurrentDataFlavors() in my dragOver(DropTargetDragEvent event) method is not returning any data flavours unless I drag over to another JTree. If I now drag back over to the source JTree (so that DragSource and DropTarget are again the same) as if by magic I now get DataFlavours whilst dragging over the source container.
    This is driving me nuts! :-)
    Has anybody else seen this and do they have a solution?

    I have the same problem here.
    When I try to perform drag and drop in a JTree (DragSource and DropTarget are the same), calling event.getCurrentDataFlavors() in the dragOver(DropTargetDragEvent event) method in the DropTargetListener returns me nothing!!
    However, the call of event.getCurrentDataFlavors() in the
    drop(DropTargetDropEvent event) does return me the correct
    information.
    On the doc, the DropTargetDragEvent.getCurrentDataFlavors()
    should mimic DropTargetDropEvent.getCurrentDataFlavors().
    So, I suppose both functions should work in the same way
    properly.
    Is there anything wrong with my understanding or is that a bug
    of the Java dnd?

  • Drag and Drop Test

    Hi ,
    I am building a Quiz where we have a Drag and Drop Question ,with Option from 1 - 5 Randomly displayed , User have to put them in a right order for the answer to be correct..When the Answer is correct , a Movie Clip Pops up showing its the Correct Answer
    I am taking questions out of an XML File , but don't know how I would define a SET of option to be a correct answer in this ,
    Anyone with a Code would be a great help , here is what I have in my AS3 Code
      private function fn_showQuestionDragAndDrop():void
       mc_questionDragAndDrop.visible     = true;
       mc_questionDragAndDrop.y        = (277 - ((6 -( txt_question.numLines))*21.6));
       arr_objects = new Array();
       while(mc_questionDragAndDrop.numChildren > 0)
        mc_questionDragAndDrop.removeChildAt(0);
       var arr_dragOptions:Array =  new Array();
       for(var i:uint = 0;i< xml_questions.problem[int_currentQuestion].answers.answer.length() ;i++)
        arr_dragOptions.push(xml_questions.problem[int_currentQuestion].answers.answer[i]);
       arr_dragOptions.sort(randomSort);  
       for( i = 0;i< xml_questions.problem[int_currentQuestion].answers.answer.length() ;i++)
        var mc_counter:mc_questionDragAndDropCounter       = new mc_questionDragAndDropCounter();
        mc_counter.txt_caption.text     = String(i+1)+":"
        mc_questionDragAndDrop.addChild(mc_counter);
        mc_counter.y          = 32*i;
        mc_counter.x          = 27.9;
        var mc_option:mc_questionDragAndDropOption = new mc_questionDragAndDropOption();
        mc_option.txt_caption.text     =  arr_dragOptions[i];
        mc_questionDragAndDrop.addChild(mc_option);
        mc_option.y          = 32*i;
        mc_option.x          = 48.05;
        mc_option.buttonMode       = true;
        mc_option.mouseChildren      = false;
        mc_option.id = i;
        mc_option.addEventListener(MouseEvent.MOUSE_DOWN,fn_mouseDown);
        mc_option.addEventListener(MouseEvent.MOUSE_UP,fn_mouseDown);
        arr_objects.push(mc_option);
        mc_option.X = mc_option.x;
        mc_option.Y = mc_option.y;
    Here is the XML Code
    <problem id = "4">
      <question type = "DragAndDrop" >At uncontrolled intersections or situations, the hierarchy rule applies. Drag and drop the below into the correct hierarchical order.</question>
      <answers correct = "1">
       <answer>Emergency vehicles driving under priority flashing lights &amp; siren</answer>
       <answer>Explosive trucks, working graders and dozers</answer>
       <answer>Haul trucks</answer>
       <answer>Other heavy equipment</answer>
       <answer>Light vehicles</answer>
      </answers>
    </problem>
    How can I define a Pattern to be Correct Answer in this case?

    Thanks a lot for the help ,
    I tried the Code with addition of adding a Movie Clip (correct) or (wrong) based on answer  to it which I am doing with the rest of the questions , but its not doing anything
    Here is my Code , Part of the Problem can be that there is NO one Correct Answer here , actually , user have to set the Lines of Text in the right order and that would be considered a correct answer
    Here is my Code in AS3
    if(Boolean( xml_questions.problem[int_currentQuestion].answers.answer.@correct)){
        correct.visible        = true;
        correct.correct_txt.text      = String("Correct Answer");
        Root.arr_score[int_currentQuestion]   = 1;
       }else{
        attempt--;
        wrong.visible = true;
        wrong.wrong_txt.text = String("Wrong Answer - " + attempt + " /3 Attempts");
        Root.arr_score[int_currentQuestion]   = -1;   
    and in the XML I did what you asked , but I don't know how to set it up that Flash would understand that the Selection is in the Right Order now

  • Drag and drop music to second iphone

    The latest version of iTunes is driving me crazy. I've just dragged and dropped albums I've copied into iTunes onto my iPhone 4s with no problem.  I've now plugged my wife's iPhone 4s in, her iPhone is showing in the left iTunes column, but when I try to drag albums into her phone there's no blue border around her phone so I can't put albums on it for her. Help me please, as I'm getting desperate. Also, I don't want to lose any of the Apps or albums already on her iPhone, which I put on there using an old PC we've just replaced with a Windows 8.1 PC.

    Go to the Summary page for your iPhone and confirm that the option to manually manage music and videos is set. If not, check the box and give it another try.
    Regards.

  • I want to Sync my iPhone 4 to iTunes however I get an error message from iTunes each time I connect the phone to the PC saying that I should restore to factory settings. Frustrating because it's already annoying enough that I can't drag and drop mp3's!!!

    I have never been so frustrated before in my life with any phone. I find it obnoxious as it is that I cannot simply drag and drop files (especially MP3's) straight from my PC directly into my phone, which I have been used to doing up until now. Everyone who convinced me to get the iPhone has instructed me that my frustration can be fixed by downloading iTunes and syncing it all up via that program (which I have never used before). So, I downloaded the program successfully, however when I connect the iPhone 4 to the PC and iTunes is open, I get an error message that 'iTunes cannot read the content of the iPhone "iPhone" and that I should go to the Preferences tab of the iPhone and select 'restore' to restore this phone to factory settings. First of all, I don't understand why I need to do that. I have already downloaded apps and other important things in the 2 days that I have the phone. I am also scared that it will erase my contacts. This is such a headache. Music is very imporatant to me, but I am getting so frustrated that I don't have freedom over the phone which I thought was supposed to be one of the best out there. I would really appreciate help in this matter. I am sure the phone is great but I am on the verge of taking it back and getting something else.

    Hey joshuafromisr,
    If you resintall iTunes, it should fix the issue. The following document will go over how to remove iTunes fully and then reinstall. Depending on what version of Windows you're running you'll either follow the directions here:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/HT1925
    or here:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Best,
    David

  • When I drag and drop an icon from the address bar to the desktop is does creat the shortcut but will not display the website icon, only the firefox icon, how can I display website icons?

    When I drag and drop a website icon from the Forefox address bar to the desk top, the short cut is created but the icon that appears is the firefox Icon. I want to disply the icon from the website that the short cut refers to. I have checked all I can think of in my computer to no avail.

    You have to assign the favicon yourself to the desktop shortcut (right-click the shortcut: Properties) after you have dragged the link to the desktop.
    You can usually find the favicon in Tools >Page Info > Media and save the icon there.
    Otherwise use the main domain of the website and add favicon.ico (e.g. mozilla.com/favicon.ico ) to display the favicon in a tab and save that image to a folder.

  • Is there any way of dragging and dropping an iCal event showing in week view across to a date in the left sidebar monthly calendar?

    Hi, Im not a frequent forum poster, as most of my questions can be found already answered on them!
    This is a question Ive had for a long time and it amazes me that no-one else seems to ask it. I check at each OS upgrade but its never there...
    Is there any way of dragging and dropping an iCal event showing in week view across to a date in the left sidebar monthly calendar?
    I was able to do this years ago in MS Outlook, and utilized it all the time when I needed to push things back, now I have to open the event and select an new date in the drop-down calendar for each & every event I want to move to a new month at the end of the month.
    If its definitely not possible, how to you ask apple to consider including it - it doesnt seem like a particularly difficult task.
    Thankyou
    Andrew.

    Andrew,
    Is there any way of dragging and dropping an iCal event showing in week view across to a date in the left sidebar monthly calendar?
    No, but you can use cut/paste. Cut (⌘X) the event, then click on the week where you want to move the event, and Paste (⌘V).
    If you have a suggestion for Apple to change that method use: Apple - Mac OS X - Feedback.

  • Why does not drag and drop work?!

    Hello,
    I am trying to implent a drag and drop from a table to an icon representing a trash.
    The drop handler fails in converting the selected rows to a list:
    com.sun.el.MethodExpressionImpl@87d9c00d javax.el.ELException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
    Could you help me to understand why? Below are the details.
    This is the af:table:
    <af:table var="row" rowBandingInterval="0" id="t1"
    value="#{bindings.MyView1.collectionModel}"
    rowSelection="multiple"
    columnStretching="last"
    horizontalGridVisible="false"
    verticalGridVisible="false" fetchSize="-1"
    autoHeightRows="6" width="190"
    disableColumnReordering="true">
    <af:column sortable="true" headerText="Entry" id="c1"
    align="start">
    <af:outputText value="#{row.Description}" id="ot1"/>
    </af:column>
    <af:dragSource actions="MOVE" defaultAction="MOVE"
    discriminant="delete"/>
    </af:table>
    This is the drop area:
    <af:image source="Images/empty_trash_32.png" id="i2">
    <af:dropTarget dropListener="#{backingBeanScope.DropHandlerBean.dropHandler}"
    actions="MOVE">
    <af:dataFlavor flavorClass="org.apache.myfaces.trinidad.model.RowKeySet"
    discriminant="delete"/>
    </af:dropTarget>
    </af:image>
    This is the failing listener listener (the failing point is bold):
    public DnDAction dropHandler(DropEvent dropEvent) {
    DnDAction dnda = DnDAction.NONE;
    if (dropEvent.getProposedAction() == DnDAction.MOVE) { // delete
    RichTable table = (RichTable)dropEvent.getDragComponent();
    //determine the rows that are dragged over
    Transferable t = dropEvent.getTransferable();
    //when looking for data, use the same discriminator as defined
    //on the drag source
    DataFlavor<RowKeySet> df =
    DataFlavor.getDataFlavor(RowKeySet.class, "delete");
    RowKeySet rks = t.getData(df);
    if (rks == null) {
    return DnDAction.NONE;
    Iterator iter = rks.iterator();
    while (iter.hasNext()) {
    //get next selected row key
    System.out.println(rks.toArray().length); // the number of selected rows is ok
    List key = (List)iter.next(); // here gives: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
    //make row current so we can access it
    table.setRowKey(key);
    //the table model represents its row by the ADF binding class,
    //which is JUCtrlHierNodeBinding
    JUCtrlHierNodeBinding rowBinding =
    (JUCtrlHierNodeBinding)table.getRowData();
    Row row = (Row)rowBinding.getRow();
    //delete row;
    row.remove();
    //activate animation
    dnda = DnDAction.MOVE;
    return dnda;
    thanks.

    I did try, I obtained this:
    java.lang.NullPointerException
    Why NullPointerException?
    I don't know if this helps, but consider that the collection model comes from a ViewObject built on three EOs with many fields, although the table only shows one column.
    This is the Iterator in my pageDef:
    <table IterBinding="MyView1Iterator" id="MyView1">
    <AttrNames>
    <Item Value="Cod1"/>
    <Item Value="Cod2"/>
    <Item Value="Cod3"/>
    <Item Value="Cod4"/>
    <Item Value="Description"/>
    <Item Value="Cod5"/>
    </AttrNames>
    </table>
    Any idea?
    I will see the Key content with the debugger.

  • Did my first back up today using external hard drive and time machine now i can't drag and drop

    Hi, i did my first back up today using time machine it all went onto my external hard drive fine. Now i cant drag and drop anyhting. I assume ive cahnged some settings in time machine but cant figure it out what to do can some one help ?
    thanks

    Brandbasher wrote:
    Thanks Pondini but i have closed time machine, removed external hard drive.
    Did you eject it first?
    Now i cant drag and drop anything on my desk top, or mail or any other application. Ive tried moving folders, documents none of it works. Even moving around documents within a folder, it wont let me chnage the position of files.
    That shouldn't be related to Time Machine (especially if the backups aren't mounted).
    What happens when you try those things?  Do you get any messages?  Anything you can post a screenshot of?
    Have you tried a Restart?
    Does it happen in another user account?  (If you don't have one, create one via System Prefs > Users & Groups.)

Maybe you are looking for

  • How to display an XMl file in a webydynpro Application.

    Hi All, I am working with a webdynpro application where i have an xml file. when ever i run the webdynpro application it has to display that xml file in the browser instead of view. It would be appreciable if anyone give me some idea on how to start

  • Intercompany billing has 2 line items referring to the same salesorder item

    Hi All, I am posting Intercompany billing documents using Idocs. I am using the standard function module that creates INVOICE IDocs, but these Idocs are failing with error text "Document contains same order item more that once". The problem lies here

  • Screen res of director movies

    As a new person to making director cd/dvds. What are the professionals doing for resolutions/stage sizes for director movies that play full screen? 800 x 600 seems better for memory and yets seems to small these days. What are most "professonals" doi

  • Formatted search in CHSH in non exists tables or UDO

    Hi I found out that i have formatted searches associated in to tables and UDO that no longer exist, How can i delete that information from CHSH? I need to delete those queries. Kind regards

  • APEX 3 installation

    We have 9i (9.2.0.5) database which has its own HTTP server running. To install APEX 3.0 , do we have to install old HTMLDB from oracle 10g companion cd first and then upgrade it to 3.0 or can we just unzip apex_3.0.zip to a new folder and then execu