How do I drag a file out of Swing to Windows

I have an application which has BLOBs stored in a DB. From either Windows or Linux I can drag a file and drop it into my application and store it in the DB.
I have also enabled a JTable to act as a Drag source, and I by encoding the result as a uri-list I can send back a reference to the data as a URL pointing to the internal web server in my app (using the new internal server in Java-6) and I can drag the object onto a KDE folder, or a KDE media player, or Konqueror and it works as expected.
But under Windows only IE (or I presume Firefox but I have not tried that) seems to want to accept this uri-list, Windows Media Player and file Folders do not want to accept it.
I need to stream the data out as the files are quite large and so creating a temporary file as the drag starts slows the start of the drag down in a very non-intuative way (for the user).
I am using the Java-6 D&D mechanisms, using a TransferHandler.
I also tried sending the data out as a file:// entry in the uri-list, but again only explorer seemed to understand it.
Looking at the tutorial on D&D it only talks about object drags, where the object is the content rather than transfering files.
Thanks for any help
David

That works if all the data is available as a file at the point where you start the drag.
In my case it is not, I have got to go get it from the database, and that can take up to 30 seconds.
So I want to do that bit when the drop happens (which users are used to as for instance when they copy a large file in Windows at the moment), not when the drag starts (which is very difficult to provide any visual feedback for).

Similar Messages

  • HT201250 How do I restore photos from Time Machine?  All of my photos have been imported within iPhoto and therefore are exported to Time Machine via an iPhoto file.  I can't figure out how to break individual photo files out of the iPhoto file.  Any idea

    How do I restore photos from Time Machine?  All of my photos have been imported within iPhoto and therefore are exported to Time Machine via an iPhoto file.  I can't figure out how to break individual photo files out of the iPhoto file.  Any ideas?

    You might post this query on the iPhoto forum and perhaps someone there can provide an answer.
    I tried this on my MBP and it seems that you have to restore the entire iPhoto Library.  What I did was put the current library in a separate folder on the desktop and then I restored the library from a prior date.  If you were to do that, you then could extract the desired photos and then delete the restored library.  Then place the current library back to the original location and import the desired photos.
    Not tidy but it seems it will work.
    Ciao.

  • How to execute a exe file using javascript on app window.load.

    How to execute a exe file using javascript on app window.load.

    Hi sb00349044,
    As I have already mentioned in multiple replies to your previous questions, the SUMO forums focuses on providing help to end users with usage-questions and issues.
    For developer-related questions, please refer to one of the many resources readily available that I have linked to in the past:
    * [https://developer.mozilla.org/en-US/Firefox_OS MDN]
    * [http://stackoverflow.com/questions/tagged/firefox-os StackOverflow]
    * [https://lists.mozilla.org/listinfo Mozilla Mailing Lists]
    - Ralph

  • How can I get settings files out of the Library folder?

    I had to do a clean reinstall (erase & reinstall) to clear up some problems on my Mac. Unfortunately, when you do this, your settings, customizations, bookmarks etc. aren't transferred over as they do when you upgrade in the normal way.
    For example, dashboard widgets are in each user's <home folder>/Library/Widgets folder.
    I could restore some of these settings by dragging the settings files from the old System Folder to the new one. Unfortunately, Apple is making this harder by hiding the Library folder in the user folder, both on the Mac and on the backup drive.
    There is a command to enter in Terminal to show your Library folder, but this only seemed to work on the Mac and not on my backup drive.
    How can I get key settings files out of the Library folder on my backup drive when the Library folder is hidden?
    Thanks

    Open the enclosing folder, choose Go to Folder from the Finder's Go menu, and provide Library as the path.
    (80699)

  • How to create a PS file out of Freehand MX?

    I am new to these forums, and wonder if anyone can help
    clarify a question:
    How to create a PS file with fonts embedded, out of Freehand
    MX?
    I am very late in making the transition to OSX /Freehand MX /
    CS1 (better late than never).
    Up until recently I have been using Freehand 8/9 under OS 9.2
    to create a Postscript file, selecting 'Embed All Fonts' in the
    save to file dialog box. Then distilling the PS file through
    Acrobat Distiller 5 with press ready settings. All works fine and
    no problems with the printed results.
    Now running FH MX under OSX (10.2.8 Jaguar?) I have added a
    virtual PS printer but I am unable to work out how to successfully
    embed fonts, and would much appreciate any advice!! Thanks in
    advance.

    I would be careful saying that the resolution is correct for
    any
    publication. Newspaper print is typically at 85 lpi where as
    standard
    press printing (even magazines) is 150 lpi or higher. These
    require 170
    and 300 ppi images, respectively. Not knowing what the
    D6Dispatch
    preset gives you I would think it's closer to 170 than 300
    which would
    not be enough for most print needs other than newspaper.
    Also, your directions for finding the PS option are when
    using OS X 10.3
    or earlier, which is what the original poster is using. For
    others, in
    10.4, it is found in the "PDF" button found at the bottom of
    all option
    sections. It is labeled oddly as "Save PDF as PostScript".
    Rich
    JerseyThursday wrote:
    > This is how I create press ready PDF files (for print
    ads) from Freehand MX (os
    > X) with the fonts embedded.
    >
    > Out of Freehand, I click print. In the print dialog box,
    on the third
    > pull-down bar (should say ?copies and pages?) I pull it
    down to the ?output
    > options? selection. From there I check the box ?save as
    file? and then select
    > postscript from the format options. This creates a PS
    file.
    >
    > I then distill this PS file in Acrobat distiller (comes
    with Acrobat
    > Profesional) using the job option D6Dispatch (this is a
    Columbus, OH
    > newspaper). You can download this distiller option free
    from:
    >
    http://printads.thisweeknews.com/
    >
    > Works great for 4 color and black and white ads. The
    fonts are embedded and
    > the resolution is correct for any publication
    >
    >

  • How do I move PDF files out of iBooks and into Goodreader?

    Question. How do I move my PDF files out of iBook and into Goodreader. ??

    I may havE found why the files disappear in the first place.
    In iTunes, after connecting your iPad, check on the sync list. Click the "books" tab and be sure that "Books and PDF files" is selected. Then go thru the list and be sure all the PDF files you want to save are checked.
    Perhaps this wasn't done causing the PDF files to not be synced and thus restored during the conversion to iOS5.
    Thanks for your help. I will stop worrying about it and in any case, I  now have several ways to recover those PDF files.

  • How do you drag a file into Apple Mail when it's full-screen?

    I love the full-screen mode for Apple Mail.  However, when I attach files to mail messages, I prefer to drag files to my message (since they often come from various finder windows I might have open).  However, in Mission Control or via swiping, I couldn't find a way to drag and drop a file in there.
    I also tried dragging the file to the Mail icon on the dock, which spring-loaded the full-screen Mail app, but when I tried to drop it into the New Message window, it flashed but nothing happens.
    Kinda annoying you can separate the New Message window into a separate mail window.  Often I like having my New Message window dragged to another desktop so I can type an email in the context of reviewing and image mockup, etc.
    Conrad

    I guess for me, sometimes I start typing the email and then decide to attach something.  Or want to attach files from different folders to a single email.  Your tip unforunately doesn't work in those cases.  Maybe it's just me, but attaching files often is the last thing I do right before I send the mail.

  • How can I drag a widget out onto my desktop

    I used to be able to hold down  a function key and it would allow me to drop a widget onto my desktop as so I could use it anytime. Does anyone know what I'm talking about?
    If so, do you know what keys I press while I drag the widget out from the app onto my desktop?
    Thank you

    You can drag the favicon on the left end of the location bar onto the desktop to create a shortcut.
    You can also use an extension.
    * SaveLink: https://addons.mozilla.org/en-US/firefox/addon/savelink/
    * Deskcut: https://addons.mozilla.org/en-US/firefox/addon/deskcut/

  • How to Update existing XML File Using Java Swing

    Hi,
    I am reading XML file and getting keywords into JList. When i add some keywords into JList through textfield and remove keywords JList, then after click on save button it should update xml file. How can i do it ?
    Please provide me some code tips for updating xml file
    This is the code that i am using for reading XML File:
    import javax.swing.*;
    import java.awt.event.*;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    import java.io.IOException;
    import java.util.*;
    import java.text.Collator;
    import java.util.regex.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import com.cloudgarden.layout.AnchorConstraint;
    import com.cloudgarden.layout.AnchorLayout;
    public class getKeywords extends JFrame implements ActionListener
    static JPanel p;
    static JLabel lbl;
    static JButton btnSave,btnAdd,btnRemove;
    static String path;
    static Vector v;
    static JList lstCur;
    static JTextField txtKey;
    Document dom;
    static image imgval;
    NodeList nodelstImage;
    static AnchorLayout anchorLay;
    private DefaultListModel lstCurModel;
    public getKeywords()
         super("Current Keywords");
        v=new Vector();
        p=new JPanel();
        txtKey=new JTextField(10);
        btnAdd=new JButton("Add");
        btnRemove=new JButton("Remove");
        btnSave=new JButton("Save");
        lbl=new JLabel("Current Keywords");
        lstCurModel=new DefaultListModel();
            lstCur=new JList();
            JScrollPane scr=new JScrollPane(lstCur);
        runExample();
         lstCur.setModel(lstCurModel);
         p.add(lbl);
         p.add(scr);
         p.add(txtKey);
         p.add(btnAdd);
         p.add(btnRemove);
         p.add(btnSave);
         add(p);
         btnAdd.addActionListener(this);
         btnRemove.addActionListener(this);
         btnSave.addActionListener(this);
         setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    public static void main(String arg[])
         getKeywords g=new getKeywords();
         g.resize(250,400);
         g.setVisible(true);     
    public void actionPerformed(ActionEvent ae)
         if(ae.getSource()==btnAdd)
              lstCurModel.addElement(txtKey.getText());
         if(ae.getSource()==btnRemove)
              lstCurModel.remove(lstCur.getSelectedIndex());
         if(ae.getSource()==btnSave)
              //Code to Write
         public void runExample()
              //Parse the XML file and get the DOM object
              ParseXMLFile();
              //Get the Detail of the Image Document
              parseImageDocument();
              //Get the Detail of the LML Document
              //parseLMLDocument();
              //System.out.println(lmlval.Title);
         public void ParseXMLFile()
              //Get the Factory
              DocumentBuilderFactory builderFac = DocumentBuilderFactory.newInstance();
              try
                   //Using factory get an instance of the Document Builder
                   DocumentBuilder builder = builderFac.newDocumentBuilder();
                   //parse using builder to get DOM representation of the XML file
                   dom = builder.parse("LML.xml");
              catch(ParserConfigurationException pce)
                   pce.printStackTrace();
              catch(SAXException sax)
                   sax.printStackTrace();
              catch(IOException ioex)
                   ioex.printStackTrace();
         public void parseImageDocument()
              //Get the root element
              Element docImgEle = dom.getDocumentElement();
              //Get a nodelist for <Image> Element
              nodelstImage =  docImgEle.getElementsByTagName("Image");
              if(nodelstImage != null && nodelstImage.getLength() > 0)
                   for(int i = 0; i < nodelstImage.getLength(); i++)
                        //Get the LML elements
                        Element el = (Element)nodelstImage.item(i);
                        //Get the LML object
                        getImage myImgval = new getImage();
                        imgval = myImgval.getimage(el);
                        v.addElement(new String(imgval.Thumb));
                        String[] x = Pattern.compile(",").split(imgval.Keys);
                        for (int s=0; s<x.length; s++)
                        lstCurModel.addElement(x[s].trim());
                        //System.out.println(x[s].trim());
    }     Thanks
    Nitin

    You should update your DOM document to represent the changes that you want made.
    Then, using the Transformation API you simply transform your document onto a stream representing your file. Something like this:
    Transformer transformer = TransformerFactory.newInstance().newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
    // TODO - set indentation amount!
    Source source = new DOMSource(dom);
    Result result = new StreamResult(file);
    transformer.transform(source, result);Hope this helps.

  • How to Open Two Excel Files in Multiple Monitors in Windows 7

    How to open two excel files in two excel windows using multiple monitors in Windows 7.
    Currently it opens multiple files on top of each other on the same one monitor.
    I found this article in a blog it says
    "The snap feature that you are looking for will not work unless you open two instances of Excel. This is because Excel Unlike Word is not a True SDI Application. Microsoft is aware of the Issue however there is no resolution to the problem but the workaround"

    If you are working almost the entire day in front of your computer at your office with lots of Excel Sheets and Word, then probably you might be working with a
    dual monitor or may be even more than that. Studies have shown that having an additional monitor increases the productivity by 20 to 30 percent (Source: NY Times)
    But some applications like MS Office Excel, even though you open multiple files, they are all from the same instance of the application. So if you want to compare two
    Excel
    files, then you may not be able to have it in two
    separate monitors as the files are loaded using the same instance of Excel. If you move one
    Excel
    file to the other window, the other Excel files are also moved to the other window.
    So how to have two separate Excel files or other application side by side in dual monitors?
    Option A:
    In Excel 2003, go to Tools -> Options ->
    General tab.
    Make sure the option, ‘Ignore other applications’ is checked. Now all the Excel files will be opened as separate instance and you can move the Excel files individually across the monitors.
    In Excel 2007, Click the Office button ->
    Excel Options -> Advanced.
    Under General, check ‘Ignore other applications that use Dynamic Data Exchange’.
    or
    As this method forces each Excel file as a separate instance, the memory consumption will be more. If you don’t want too many memory consumption then you can open only two instances (see
    Option B) and manage wisely to view in both the monitors.
    Note: If you are having issues like Excel opens without displaying a workbook, then you may have to
    uncheck this option. (See Microsoft Help for more details on this). You can use option B in this case. I have this option checked and I have not faced any issue yet.
    Option B:
    They key here is, the application has to be loaded as separate instances. Lets say you have opened an Excel file in
    Monitor 1 and you want to open the next excel file in Monitor 2. You can usually open another instance of Excel by browsing through the
    Start Menu -> Programs -> Microsoft Office ->
    Excel. Make sure this newly opened Excel file is the last Excel file you had viewed and then double click on the Excel file that you wanted to open. This will force the Excel to
    open
    in the second instance of Excel. Now you can move these
    two excel files separately across windows or monitors.
    This may be little cumbersome way to open new instances of Excel every time. The easy solution would be to keep these links in the
    quick links near the Start button. So, every time you want to open a new instance of the application, you can just use those quick links.
    hope work thanks
    http://www.lytebyte.com/2008/05/13/how-to-open-two-excel-files-side-by-side-in-separate-monitors/

  • How do i drag multiple files and move to a folder

    I just purchased an IMAC and would like to transfer all of my photos from my old Dell laptop to my IMAC. I am using a USB Flash Drive and now I need to know how to drag multiple items and move the the pictures file? it will only let me move one at a time and this will take forever! I have the magic mouse. I have figured out how to choose/highlight multiple photos but i cannot figure out how to drag them over to the pictures file.

    If you're not used to spring-loaded folders, it may be helpful to open a second Finder window (⌘N) and navigate that to the target folder, so you can just drop them straight in.

  • How to make a text file out of a bunch of strings

    Hey Guys,
    Can anyone please tell me how I can make a text file that stores a bunch of strings. I have some strings that store some values. I want to know is there a way so that I can just keep on appending the string values to the text files. Please reply. Any help would be appreciated.
    Thank you,
    Vivek

    boolean appendToFile = true;
    // will create the file if it does not exist...
    // will append to the file (at the end of the file) if it exist
    PrintWriter out = new PrintWriter( new BufferedWriter(
         new FileWriter("term.txt", appendToFile)) );     
    out.println(str);   // print the string and append a newline character
    out.print(str);     // print the string
    out.close()         // close the file when done (release the resource)
            

  • Question on URLFilePromise for dragging remote file out

    Now I'm on-going developing an Air desktop application in which remote files need to be dragged out and stored in local file system.
    Remote files can be dragged out and stored in local file system in my demo project,however when I merged the demo code to my
    app project,it can't work correctly.I find that the URLStream wasn't connected as I registered a function to listen the
        event: Event.OPEN
    and the listener function wasn't called.
    And also there is no corresponding http request captured with the capture utility:Wireshark.
    Could anyone give me some tips to work out the problem.
    Thanks a lot!
    Below is my code:
    private function onMouseDown(event:MouseEvent):void 
    var dragAttach:Clipboard = new Clipboard();
    if(true == dragAttach.supportsFilePromise)
    var filePromise:URLFilePromise = new URLFilePromise();
      var attachURl:String = GlobalConfig.HTTP_SERVER_ADDRESS +
    "/" + _srcUname +
    "/" + _fileType +
    "/src/" + _attachID;
    trace(attachURl);
    filePromise.addEventListener(Event.OPEN, onURLStreamOpen);
    filePromise.addEventListener(IOErrorEvent.IO_ERROR, onError);
    filePromise.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecrityError)
    filePromise.addEventListener(ProgressEvent.PROGRESS, onProgress);
    filePromise.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHttpStatus);
    //attachURl = "http://192.168.6.229/dragAttach/hello.png";
    attachURl = "http://ln.cn/swf/mm.png";
    trace(attachURl);
    filePromise.request = new URLRequest(attachURl);
    filePromise.relativePath = _fileName;
    var fileList:Array = new Array();
    fileList.push(filePromise);
    // only allow the file to be copied
    var dragOptions:NativeDragOptions = new NativeDragOptions();
    dragOptions.allowMove = false;
    dragOptions.allowCopy = true;
    dragOptions.allowLink = false;
    var setRes:Boolean = dragAttach.setData(ClipboardFormats.FILE_PROMISE_LIST_FORMAT, fileList);
    this.addEventListener(DragEvent.DRAG_COMPLETE, onDragComplete);
    NativeDragManager.doDrag(this,
      dragAttach,
      _dragImage,
      new Point(-mouseX, -mouseY),
      dragOptions);
    return;

    yes..EOIO will block the queues if its predecessor are not in final state...
    for ur design u can rfer the below wiki...instead of RFC u can use soap adapter..
    http://wiki.sdn.sap.com/wiki/display/XI/File-RFC-File%28Without%20BPM%29

  • How do you drag compressor File to DVD SP?

    I am new to compressor, I exported to Compressor from FCP used the High quality 90 minute mpeg 2 setting. I dragged the pass.m2v video file in, but I cant find the audio file. I have exported 4 times from FCP to Compressor, and pressed the submit button thinking i was missing a step, and I don't find any audio file. Am I doing something wrong? Thanks,
    Doug

    The Compressor job needs the .m2v setting AND the Dolby audio setting.
    So you drag the Setting folder, not just the video setting.
    Normally both compressed files will appear in the same place.

  • How to create one pdf file out of several pages documents?

    I have created several seperate pages documents and want to merge them now to one pdf file. Currently if have exported only single pages documents in the pdf format to the documents app from readdle. I would prefer to order them in pages (e.g. in a folder) and convert the whole folder afterwords to a single pdf document.
    Maybe there is another and better way to do it. Your help is very welcome.

    In iOS:
    Combine the pages files into a single document, (Pages will not batch print)or
    Find an app for iOS that will facilitate combining PDF files into a singe file. (To be honest, I have my doubts about finding one).

Maybe you are looking for