Drag and drop file onto java app

Hi,
I would like to drag and drop a file from windows explorer onto a panel in my java app.
All I need is that when the file is 'dropped', I can get a reference to the path of file.
e.g.
There is a file, C:\myFile.txt
There is a String in my program called 'filePath'.
I start my java app and dnd the file onto it.
I want the path of the file to be assigned to the filePath String.
I can then do more proccessing on the file which I already know how to do.
Can anyone help.
Thanks,
Jim

Tristan,
I am stuck in the same place. Perhaps we could work on this together.
I am trying to drag a single item from a JList to a text editor, Word, etc. I have two problems:
1) I can't seem to get just the item in the JList to drag. It wants to drag the entire JList component.
2) How does one define the remote application as the drop target? Have not found any examples either.
Is the drop target actually the system clipboard?
Rp

Similar Messages

  • Drag and Drop file FROM Java app TO native desktop

    I'm a litte new to Drag and Drop. After a few days of looking around I've been through enough examples to copy and paste some skeleton code and get it working in my own application.
    What I haven't gotten any answers to (after searching on google, newsgroups, and here) is if it's possible to drag something from a Java app to the desktop or file browser, and have java create a file there.
    I know you can drag text to native apps, so I was wondering if you could make a Transferable object that's different than StringSelection(), like a file stream or something.
    Thanks,
    Tristan

    Tristan,
    I am stuck in the same place. Perhaps we could work on this together.
    I am trying to drag a single item from a JList to a text editor, Word, etc. I have two problems:
    1) I can't seem to get just the item in the JList to drag. It wants to drag the entire JList component.
    2) How does one define the remote application as the drop target? Have not found any examples either.
    Is the drop target actually the system clipboard?
    Rp

  • Can't drag and drop files onto Applications in Dock since upgrading to 10.6

    Ever since my wife upgraded her iMac (2 GHz, 2 gigs) to 10.6, she can no longer drag and drop files onto certain applications in her dock to open the file. She has to go into the application and go to "open file" or whatever.
    For example, if she has a Word doc on her desktop, she cannot drag it onto the Word icon in her dock.
    Any advice?

    You have many issues with your and your wife's machine(s). Everything you've posted works here. Reinstall Snow Leopard, repair permissions, and see if that fixes things.

  • Drag and Drop Files Onto EXE Icon

    I was wondering if there is a way to have the user drag and drop files onto the .exe icon and this would initiate the program to do something with those files automatically?
    For example: Some PDF convertor programs allow you to drag and drop documents, images, etc. directly onto the PDF convertor icon on your desktop and it will automatically convert them all to PDF's, without the user even having to open the program.
    Can this same type of functionality be done with a Labview EXE file?
    Solved!
    Go to Solution.

    Thank you! That did it.
    The only side note that I would include to others that are trying this is to make sure you have the "Pass All Command Line Arguments to Application" box checked in the "Advanced" section when you build the executable.

  • Finder - Can't drag and drop files onto stacks on the desktop anymore.

    Hi,
    This might sound like a strange question but in the past I was able to select a group of files in a window and drag that group to the desktop where they would stack upon one another creating a neat stack of all the files in one place. Now when I do this they drag onto the desktop and remain spread out all over the place. It's not terribly difficult to deal with except if I'm dragging say, 30 photos onto the deskop. Before they appeared stacked upon one another and I could simply drag one off the stack one by one. I am however experincing harsh symptoms of OCD because I can't figure out why. My co-worker's Mac is the same as mine (both running 10.8.2) and his files stack just fine.
    I've done a fresh install after having no luck and it's till doing it.
    This is really bumming me out. Any suggestions are very welcome. I've even booted into safe mode and it still won't stack drag and dropped files onto the desktop.
    Thanks for any advice,
    -Jason

    Relaunch Finder and restart Mac OS X. See if this helps.

  • Dragging and dropping files onto DVDs

    I am new to MAC and want to copy some of my written files containing photos onto DVDs for storage.
    On my old PC (not a MAC) I would simply format a new DVD and then drag and drop the files onto the disc - job done !
    However I can't find out anywhere how to do this on my MAC and a long and probably expensive phone call to Apple Tech Help, left me frustrated and no nearer finding a solution as the Tech on the phone couldn't even tell me how to format a new DVD let alone how to get my documents onto the DVD !  I don't want to 'burn' the documents  onto  the DVD as I need to add to it on a regular basis I just want to get the files copied to the DVD.  Can anyone out there tell me in simple terms how to do this please ?

    I don't want to 'burn' the documents  onto  the DVD as I need to add to it on a regular basis I just want to get the files copied to the DVD.
    The Mac supplied software doesn't support multiple writes to optical media.
    I though perhaps you could do this with Roxio's Toast, but their support site says: "As such, Toast does  not allow burning multi-session DVDS."
    how to format a new DVD let alone how to get my documents onto the DVD
    You don't "Format' a data DVD - you simply drag and drop files on the disc logo on your destop.

  • Drag and Drop Files Onto Seagate External Hardrive

    I can't seem to just drag and drop files I want to store on an external hardrive with Seagate. I hate that. I just want a simple drag and drop so I can free up some space on my computer. But Seagate just seems to just seems to say **** you, we're gonna do it backwards ***. Can someone please explain how to just drag and drop files? I have zero idea, and they don't make it simple to understand.
    So for the love of god....please explain it to me (without use of computer terminology or telling me places I should go on my computer that I don't know what the **** they are. Renders your help useless, and it's frustrating because no matter how many times I ask this, you just give me help i can't understand anyway.)
    Please....it's not hard to ask.
    If possible, use step by step instructions, if you need to tell me to go somewhere on my computer, tell me where that is too so I know where to go. Don't be vague, I can't understand vague instructions when i read them.

    What is the drive formatted as? this is extremely likely the issue.
    FORMAT TYPES
    FAT32 (File Allocation Table)
    Read/Write FAT32 from both native Windows and native Mac OS X.
    Maximum file size: 4GB.
    Maximum volume size: 2TB
    You can use this format if you share the drive between Mac OS X and Windows computers and have no files larger than 4GB.
    NTFS (Windows NT File System)
    Read/Write NTFS from native Windows.
    Read only NTFS from native Mac OS X
    To Read/Write/Format NTFS from Mac OS X, here are some alternatives:
    For Mac OS X 10.4 or later (32 or 64-bit), install Paragon (approx $20) (Best Choice for Lion)
    Native NTFS support can be enabled in Snow Leopard and Lion, but is not advisable, due to instability.
    AirPort Extreme (802.11n) and Time Capsule do not support NTFS
    Maximum file size: 16 TB
    Maximum volume size: 256TB
    You can use this format if you routinely share a drive with multiple Windows systems.
    HFS+ ((((MAC FORMAT)))) (Hierarchical File System, a.k.a. Mac OS Extended (Journaled) Don't use case-sensitive)
    Read/Write HFS+ from native Mac OS X
    Required for Time Machine or Carbon Copy Cloner or SuperDuper! backups of Mac internal hard drive.
    To Read HFS+ (but not Write) from Windows, Install HFSExplorer
    Maximum file size: 8EiB
    Maximum volume size: 8EiB
    You can use this format if you only use the drive with Mac OS X, or use it for backups of your Mac OS X internal drive, or if you only share it with one Windows PC (with MacDrive installed on the PC)
    EXFAT (FAT64)
    Supported in Mac OS X only in 10.6.5 or later.
    Not all Windows versions support exFAT. 
    exFAT (Extended File Allocation Table)
    AirPort Extreme (802.11n) and Time Capsule do not support exFAT
    Maximum file size: 16 EiB
    Maximum volume size: 64 ZiB
    You can use this format if it is supported by all computers with which you intend to share the drive.  See "disadvantages" for details.

  • Cannot drag and drop file from photos app to photoshop

    Hi,
    I'm trying to open a file saved in my Photos library in Photoshop. Previously in iPhoto I could drag and drop the file to open in other applications including Photoshop but this functionality appears to be missing in the new Photos app. Am i missing something? Or is there another way to do it?
    thanks

    Tristan,
    I am stuck in the same place. Perhaps we could work on this together.
    I am trying to drag a single item from a JList to a text editor, Word, etc. I have two problems:
    1) I can't seem to get just the item in the JList to drag. It wants to drag the entire JList component.
    2) How does one define the remote application as the drop target? Have not found any examples either.
    Is the drop target actually the system clipboard?
    Rp

  • Dragging And Dropping Files Onto A CD / DVD In Tiger ?

    When I wanted to make a data CD in Panther (and earlier OSs) I simply dragged and dropped the files onto the CD icon.
    If you do that in Tiger it appears that all you are copying is an alias (with its little curved arrow).
    I have discovered (by experiment) that to copy onto a CD you must hold down the Option key while you drag and drop.
    Is this correct and if so can anyone tell me why the method has been changed?
    Ian.

    Hi Ian
    Aliases appear because you are not moving the files but burning them to a disc. The file will burn. You do not need to press the option key. All is explained in your Mac OS Help under "Burning a CD or DVD". You might also want to read about burn folders in the Help
    Matthew Whiting

  • Can't drag and drop files onto desktop any more

    I have always been able to drag/drop files and images onto the desktop from within the body of an email message or a web browser window. Now it won't let me do that any more and I have no idea what has changed. The cursor "holding" the image never changes into a + to allow for adding the file to the desktop. Instead, the file "bounces" back into the email body or the browser window. My only option is to do a right-click and "Save as" or click the "Save as" button in the email window.
    Thank you!
    Hanna

    Relaunch Finder and restart Mac OS X. See if this helps.

  • ITunes won't let me drag and drop files onto my iPod.

    i recently had my mac repaired and the hard drive was set back to its original settings. I had my itunes music that i had purchased restored and i have begun to download new songs to add to my ipod. itunes will not allow me drag new songs onto my ipod...can some one tell me what I am doing wrong?

    Have you selected Manually Manage Music?
    http://support.apple.com/manuals/#ipod

  • Drag and Drop files to upload snag

    I am developing a Director projector application that uploads
    a users local files to a server via an FTP Xtra. I would like to
    have an icon on the desktop that the user can drag-and-drop files
    onto and the application automatically uploads the files. I have
    created a folder on the desktop and an application that poll it for
    content to initiate the upload but the problem with this is that
    the user, by dragging files to the folder, will unknowingly move
    the files to "upload folder" and they will be removed from their
    original locations. This is obviously not what anyone desires. I
    would like to have the drag-and-drop trigger the upload from the
    file's current location.
    One solution that I have implemented is using the "Drag &
    Drop Xtra", from Meliora Software, and created a MIAW that looks
    like a desktop folder icon. The problem with this is that the icon
    is present only when the application is running and I can not keep
    it pinned down to the desktop. When it is clicked-on it will come
    to the front, like any other application. Is there a way to keep a
    MIAW pinned down?
    Another POSSIBLE approach would be to place a shortcut to the
    application on the desktop and when a file is dropped on it,
    capture the file path and pass that along to the Director
    application on startup. Is this possible? Is there an Xtra to do
    this or does Director have this capability built in?
    Ideally, we would like to have a folder on the desktop that
    only allows copy-and-paste functionality to itself but that would
    be an OS issue and out of the control of Director. Have any of you
    created such an app? Any ideas are welcomed.
    Thanks in advance.

    > Another POSSIBLE approach would be to place a shortcut
    to
    > the application on the desktop and when a file is
    dropped on it,
    > capture the file path and pass that along to the
    Director
    > application on startup. Is this possible? Is there an
    Xtra to do
    > this or does Director have this capability built in?
    this approach won't work because every time a file is dropped
    on the icon a new instance of the projector will run.
    To achieve that you need:
    1) A Director version prior to MX 2004, Director MX would be
    fine.
    2) Remove the projector's button from the task bar when it
    starts with our Window Xtra:
    wndRemoveFromTaskbar(true)
    3) Move the projector's window to the background with our
    Window Xtra:
    WndSetDepth(wndGetMain(),"back")
    4) Apply a 1-bit alpha mask to change the projector's shape
    to make it looking like an icon, again, with our Window Xtra:
    wndTransInit(member "1BitMask",false,false)
    5) Leave all the Drag&Drop Xtra code for drop as is.
    That's it, it seems MIAW isn't required.

  • Drag and drop files for burn to DVD takes FOREVER

    When I drag and drop files onto the blank DVD icon, the ghosts of said files just hang there for the longest time, and I get a spinny beach ball. Many, many minutes later things finally return to normal and I can proceed with burning the DVD. It's just copying some aliases, right? It didn't used to take more than a couple of seconds before I upgarded to Mavericks. So what the **** is taking so long now?
    PBP 2.66 Core 2 Duo, running 10.9.1, burning to a Samsung Portable DVD Writer Model SE-218

    Thanks for the reply.  If I reformat the drive will I be able to access the files on it from the MAC.  I do not share the drive with a PC.  The files were originally created on a PC which I no longer use.  I do want to continue to access the files put there by the PC.  I would like to not have to copy them over to the MAC hard drive just to use them.  The second aux drive is new and works fine because it was formatted by the MAC.  I can drag and drop files there and work with just as if they were on the internal drive.

  • Drag and Drop files from other places to universal apps(windows store)

    Hi,
    Is there a possiblity to drag and drop a file from windows desktop or from other windows store app to my application. I tried searching samples, but it says about dragging an image with in the solution.
    The best example is drag and drop files into recycle bin. Is there a way possible for modern app(instead of recycle bin), or give an user similar experince as the same.
    If not windows8/windows8.1,could we expect in windows 10.
    I believe if it is not possible with XAML/c#, the same holds good for HTML5/JS
    Thanks & Regards Tejaswi Chandrapatla

    No. This is not supported.
    We cannot comment on upcoming versions.

  • If I were to drag and drop files from an OSX 9 onto an external hard drive (1 TB), assuming there is still plenty of space left, will I be able to use this same external hard drive to back up my iMac (Mountain Lion)?

    If I were to drag and drop files from an OSX 9 onto an external hard drive (1 TB), assuming there is still plenty of space left, will I be able to use this same external hard drive to back up my iMac (Mountain Lion)?  And would it ask me if I want to initialize (thus erasing it) or eject the hard drive like the OSX 9 did?

    I was trying to follow this thread because I was curious about the OS 9 installation - until I realized you have another thread going about the very same subject, albeit with a different subject line.
    FWIW: it is best not to double post - things get far too confusing after a while.
    @ Kappy (in case you hadn't seen the other one):
    https://discussions.apple.com/thread/5054178?tstart=0

Maybe you are looking for

  • Export to text - formatting

    Post Author: Ralphred CA Forum: .NET Im trying to export a report to a .txt from within a vs2005 program, using CRXIr2. I have been able to export to the text file through code since the option to export to text isn't available for some reason when i

  • Error while copying Z program to another enviroment

    Hi, experts I have a Z program into one client's enviroment, which works fine. I tried copying this program into another client's enviroment, and i get the following error message, while syntax check: "RC_IN1 must be a byte-type field. (Typ X or XSTR

  • Using Document Management within SAP

    Hi, I'm relatively new to SAP and need to have some information about using the Document Management Services within SAP.  As with other ERP products there are drawbacks to allowing this functionality such as disk space concerns, upgrades, performance

  • Tolerance limits for Sales Orders

    Hi SAP Gurus, I have a situtation here. Customer "A" has a credit limit of 300,000 but the sales rep entered an order for 350,000. The credit analysts didn't receive any warning message while releasing the order and it's been shipped and invoiced. Ho

  • Why Can't I watch any types of videos on apps except for Instagram?

    I Can't watch videos on any apps! For example: Youtube, facebook. But I can watch videos on Instagram? It happends the same thing on My iPad 3.