Import Drag & Drop package in VJ++

I use Visual J++ for developing.
I'm trying to use Drag & Drop i.e. the java.awt.dnd.* package.
I downloaded the JDK1.3 version and added it to my CLASSPATH.
CLASSPATH=d:\java\jdk1.3\src.jar;
When I try to import the dnd package only the dragsource events and listeners are listed.
The DragSource and TargetSource aren't listed.
I've also tried adding the jdk1.3\src.jar to the CLASSPATH of the project with the same
result.
I've tried extracting all the classes into a directory and the setting the classpath to this directory.
When I then do an import all the classes appear but if you try to use say the DragSource you get "Cannot find definition for 'java.awt.dnd.DragSource'"
If I set the CLASSPATH of the project to the directory and try to compile my project I get
"Cannot load predefined class 'java.lang.Object' for the 1st class in my project.
I've also downloaded the JDK1.4 and copied the src.zip into the windows\java\classes directory renaming it classes.zip
That didn't help either.
I've run out of ideas, for being able to use this package with Visual J++, if anyone has any ideas about getting it to work I'd appreciate it.
TIA
Lynda

My personal opinion is that VJ++ is not Java and has been made on purpose by Microsoft to torpedo the lovely cross platform aspects of Java out of fear about the future of real Java language and you can forget about them being compatible.
Proper Sun compliant Java has brag and drop if you need it.
use:
java.awt.dnd.DragSource
java.awt.dnd.DragGestureRecognizer
java.awt.dnd.DragGestureListener
java.awt.datatransfer.Transferable
java.awt.dnd.DragSourceListener

Similar Messages

  • Drag&drop importing doesn't

    just updated to osx10.9/itunes11, tried drag&drop import, totally ignored d&d folder into itunes window, d&d of folder onto dock icon results in "app not found":-(
    w-t-f???

    d&d folder onto dock icon gives this

  • Import swf file with drag & drop action

    Hello!
    I created a flash animation with drag & drop.
    I imported the swf into Captivate 3, but when I publish the
    project, the animation don't work.
    Can you suggest me some workaround to understand the problem?
    Best regards

    Hi kpurple and welcome to our community
    When you published the project, did you ensure to copy all
    the associated files? Normally the added .SWF files exist as
    external files that need to exist in the same folder as your
    Captivate files.
    Cheers... Rick

  • Difference between importing images from iphoto via drag & drop vs 'media' button

    Hi (long time reader of this community, but my first post),
    i'm creating a huge document (approximately 200 pages) in Pages (5.0.1, Using Maverick on a 27 inch iMac).
    In the new version of Pages the "Media" button only produces small images that makes it difficult for me to choose which photo i want.
    Is there a difference between importing images from iphoto drag & drop vs 'media' button.
    Or is it better to just drag and drop the original jpegs (which i also have in a folder).
    Is Pages the best program to use for this type of project? it is a profolio with about 4 photos, text, text boxes etc on each of the 200+ pages.
    any help much appreciated.

    Pages 4.3 might be up to the job. I very much doubt Page 5.0.1 is.  It lacks more than 90 features of its predecessor and is very buggy to boot. You probably have an iwork09 folder in your Applications folder. I suggest you trash Pages 5.0.1 and use Pages 4.3 until Apple makestheir new "Eddie Cue" ready for prime time (if, that is, they ever do).

  • Faking Drag&Drop operation to external application

    Hello,
    a rather complicated issue. in my program i have a JTable, and i can drag&drop from this jtable
    to external programs like windows explorer by clicking the mouse and moving it from the table
    to the external program.
    how can i reproduce this exact behaviour WITHOUT user intervention?
    in other words, how can i do this programmatically, creating a drop source at the start point,
    then move the mouse, and release it above a specified location on the screen?
    is this even possible in java (as we're running in a VM) ?

    it has it's problems.
    for example, if the drop point is above the source point, moving the mouse with the robot sometimes marks all entries in the table instead of performing a drag&drop operation. also, it seems that without a delay between the moves, strange things happen. so here is an updated version which workes 99% flawlessly for me.
    package trakker;
    import java.awt.Point;
    import java.awt.Robot;
    import java.awt.event.InputEvent;
    import java.util.logging.Level;
    * this thread fakes a drag & drop operation to the traktor decks
    public class LoadDeckThread implements Runnable
         Point source;          // where was the mouse pointer before operation?
         Point track;          // where is the point of the track in the jlist?
         Point target;          // where do we move the track to?
         // constructor
         public LoadDeckThread(Point pTrack, Point pSource, Point pMoveTo)
              track = pTrack;
              source = pSource;
              target = pMoveTo;
         // thread run
         public void run()
              try
                   // create a new robot
                   Robot robot = new Robot();
                   robot.setAutoDelay(100);
                   // move the mouse to the track in the jlist
                   robot.mouseMove(track.x, track.y);
                   // click and hold
                   robot.mousePress(InputEvent.BUTTON1_MASK);
                   robot.waitForIdle();
                   // move to the left to prevent list scrolling
                   robot.mouseMove(50, target.y);
                   // and to the topleft of our app
                   Point p = Util.mainWnd.getLocation();
                   robot.mouseMove(p.x, p.y);
                   // move the mouse to the specified deck
                   robot.mouseMove(target.x, target.y);
                   // wait some time (otherwise it doesn't work?)
                   //robot.delay(500);
                   robot.waitForIdle();
                   // release the mouse
                   robot.mouseRelease(InputEvent.BUTTON1_MASK);
                   robot.waitForIdle();
                   // move back to the track
                   robot.mouseMove(track.x, track.y);
                   robot.waitForIdle();
                   robot.mousePress(InputEvent.BUTTON1_MASK);
                   robot.mouseRelease(InputEvent.BUTTON1_MASK);
                   // now move back where we were
                   robot.mouseMove(source.x, source.y);
                   robot.waitForIdle();
                   robot = null;
              catch(Exception ex)
                   Util.log("Cannot invoke robot for drag&drop: " + ex.getMessage(), Level.SEVERE);
    } instead of to close tags ;=)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Can open Topics by drag & drop, but not by double-clicking in the DITA map

    Hi,
    evidently I made an error somewhere in my structure app, the result is that I cannot open DITA topics by double clicking them in the DITA map anymore (Framemaker does simpy nothing). I can, however, open them by dragging the xml files onto the Framemaker window.  If I use the standard DITA 1.2 application everything works fine so I guess the problem is in my mapping.
    Here is what I tried to achieve:
    We need certain variations of the normal 'topic' type topic. The DTD should be identical, however different structures should be auto-inserted when creating a topic and the topic should have certain attribute values predefined.
    The idea is that the author can select one of these topic types when creating a topic, but when opening an existing topic simply edit it with the standard topic temple.
    Here is what I did:
    I duplicated the topic.template.fm, renaming it say "topic_a.template.fm", "topic_b.template.fm" etc. (just an example).
    I made adjustments to the EDD of these templates, changing the auto-insertions and the default values of some attributes.
    In the structapps.fm file I added XML applications for these new topic types, mapping each application to one of the new templates, but to the original topic DTD and r/w rules. E.g. the application "DITA_1.2_topic_a" is mapped to the "topic_a.template.fm" template, and to the original "topic.dtd" and "topic.rules.txt" files.
    In Framemaker I then created corresponding application mappings in the DITA options. E.g. the topic type "A" (which defines the visible text in the "New topic" menu) is maped to the XML application "DITA_1.2_topic_a".
    The result:
    It works as intended in every way when creating topics. The topics are saved with the standard doctype 'topic'. However for when I try to open topics from the DTD by double-clicking then nothing happens. Opening topics by drag & drop works fine though and they are opened with the normal (general) "topic.template.fm" template as desired.
    Any ideas? Was this confusing or am I completely off somewhere?
    Robert

    Hi Robert...
    When you say that you need "variations" from the normal topic type .. are those structural variations or just formatting? FM associates structure apps with XML files based on the doctype (root element). If your files all have the same root element, then they will all open with the same structure application (unless you specify a different one when opening the file or by importing a new EDD). It sounds like you really should be creating a specialization for each alternate topic type. If you don't, you'll end up getting the wrong "model" assigned to the wrong file.
    Multiple EDDs (structure apps) can share the same DTD, and one EDD (structure app) can support multiple models. This is how the "ditabase" app works. There are lots of ways to set this up, but I think what you've done is probably not quite right.
    The default structure app setup in FM11 and FM12 is very complicated to work with. I recommend creating a single app that supports many models. This isn't always possible, but it sounds like in your case it should be. I've set up one app that supports 13 different specialized topic models and it works fine.
    Note that even though you've added structure apps for each model, if you end up opening the files using the default template, you are no longer using those modified models.
    Sorry, but this is a bit more than can be dealt with appropriately in a forum post. If you'd like more help with this, feel free to contact me off list.
    Cheers,
    …scott
    Scott Prentice
    Leximation, Inc.
    www.leximation.com

  • Drag&Drop from Lightroom to Premiere doesn't work! Programming an alternative?

    Unfortunally the is no working Drag&Drop ability to drag a videofile from the Lightroom Library into the Premiere Project View.
    (This Problem appears only on a Windows machine not on Mac)
    This is becaus if you send a (valid) filepath to "Adobe Premiere Pro.exe" as a parameter it doesn't do anything! Why that?!?!?
    It makes no difference if you drop a file on "Adobe Premiere Pro.exe" or if you use the windows command shell like "C:/...<path to premiere>.../Adobe Premiere Pro.exe" "myfile.avi"  , simply nothing happens - at least with Premiere Pro CS5...
    So the Idea is to build an Lightroom Plug-In, that opens an exe-file with the filepaths of the currently selected Viedeos from the Lightroom Library as parameter.
    The exe-file should pass the information to an opened Project in Premiere an load the Videos into the Project.
    With ExtendScript Tool i can get this behaviour with this code:
    var myFiles = ["C:\\01.avi, ..."];
    app.project.importFiles(myFiles);
    I don't think that the Premiere SDK will help me out, because with that I can only build Plug-Ins that work INSIDE Premiere. I need a Executable that can send information/files to Premiere from Outside. The only thing I can think of is to load the right dll-file and call the function() for importing files to Premiere (I think this is what ExtendScript Tool does ), but I don't know how to start, because nothing is documented about the dlls...
    Any Ideas

    EDIT:
    Ok, I identified the dll which is importing Video-Files to Premiere:  HSL.dll
    At my pc it is located in:
    "C:\Program Files\Adobe\Adobe Premiere Pro CS5\"
    The function that is called is named ImportFiles(...)
    That's the whole code, reverse engineered:
    HSL::ImportFiles
        std::vector <
                    std::basic_string <unsigned short, std::char_traits<unsigned short>, dvacore::utility::SmallBlockAllocator::STLAllocator<unsigned short> >,
                    std::allocator <std::basic_string<unsigned short, std::char_traits<unsigned short>, dvacore::utility::SmallBlockAllocator::STLAllocator<unsigned short> > >
                    >
        const&,
        bool,
        bool,
        std::vector <
                    ASL::InterfaceRef<BE::IProjectItem, BE::IProjectItem>,
                    std::allocator<ASL::InterfaceRef<BE::IProjectItem, BE::IProjectItem> >
                    >&,
        std::vector <
                    std::pair<int, std::basic_string<unsigned short, std::char_traits<unsigned short>, dvacore::utility::SmallBlockAllocator::STLAllocator<unsigned short> > >,
                    std::allocator<std::pair<int, std::basic_string<unsigned short, std::char_traits<unsigned short>, dvacore::utility::SmallBlockAllocator::STLAllocator<unsigned short> > > >
                    >&,
        ASL::InterfaceRef<BE::IProjectLoadStatus, BE::IProjectLoadStatus>&,
        DLG::ImportFromEDL::ImportFromEDLDialog*,
        std::basic_string<unsigned short, std::char_traits<unsigned short>, dvacore::utility::SmallBlockAllocator::STLAllocator<unsigned short> > const*,
        DLG::ImportFromEDL::ImportNewSequenceMediaParamsDialog*
    Can anybody "read" that , or anybody know how to get this working with c++?

  • How to open more than one RAW-File by drag&drop/doubleclick with CS2?

    Hello,
    is it possible to open more than one RAW-file from iPhoto with Photoshop's RAW-converter in just one single step? If I drag&drop my selection to my Photoshop-Icon, PS opens just the iPhoto-created library-JPGs of the RAW-files but not the RAWs itself (I've turned out the copyying of the imported photos to the iPhoto-library. Instead iPhoto seems to create a JPG for the library from every RAW I import). If I doubleclick a selection of RAWs in iPhoto just the doubleclicked RAW-File will be opened in Photoshop. Is it possible to select more than one RAW-file in iPhoto and get Photoshop to open all the selected RAWs but not the JPGs? It would make my work a lot easier... thank you.
    rockenbaby

    hello
    try selecting the photos that you want however many- go, File then Export.
    you can make all your file selections image size etc and then save them direct to your PS file.
    hope this helps.
    cjp

  • Urgent!  Adobe killed drag/dropping workflow in CC.  Help restore it!

    I posted this first FR at the end of another thread, here.  Due to the importance of this issue, IMO, I'm giving this FR a new thread, plus adding as second version of the same FR.
    My stance is simple.  Every change Adobe makes to Premiere Pro should be positive to most or all people.  If a change Adobe makes is negative for most or all people, then it must be removed.
    Adobe did a negative change in CC, which brings about zero positive improvements (unless proven otherwise which has not been done yet).
    In CC, drag-dropping clips no longer  = dropping what you're dragging!  If you only have a video track source patched, audio doesn't get dragged to the Timeline.  If you only have an audio track source patched, video doesn't get dragged to the Timeline.
    This is contrary to the way it worked in CS6 (where it made sense): drag drop clip = same clip dropped, regardless of Timeline settings!
    Please help fix this by sending the following FRs as your own or writing a FR of your own based on this new problem Adobe introduced in CC.  Thank you and God bless all those that care enough about Premiere to take action!
    VERSION 1 (revert back to CS6)
    *******Enhancement / FMR*********
    Brief title for your desired feature:
    Drag/Dropping video with audio clip from Source Monitor or Project window to Timeline should include both video and audio... always!
    How would you like the feature to work?
    The way it did in Premiere Pro CS6: 
    A. Video with audio dragged from Project window = video with audio dropped in Timeline
    B. Three drag/dropping options from Source monitor, regardless of Source Patch settings.  Drag/drop:
    1. Source Monitor Image = Video + Audio
    2. 'Drag Video Only' button = Video only
    3. 'Drag Audio Only' button = Audio only
    In CC, these options no longer work properly depending on Source Patching.  This makes no sense, and provides zero benefits to the editor!
    Why is this feature important to you?
    Because intelligent workflows matter!  There's nothing intelligent or efficient about the Source Monitor's buttons working some times but not others, or drag/dropping a clip from the Project window only to find its audio doesn't appear in the Timeline.  When drag and dropping clips, Source Patching should determine default clip PLACEMENT, Not WHAT gets dragged to the Timeline!
    VERSION 2 (give us a choice!)
    *******Enhancement / FMR*********
    Brief title for your desired feature: Preferences window option to disable Source Patching's effect on drag/dropped clips.
    How would you like the feature to work?
    If Adobe can't/won't revert drag/dropping back to functional CS6 standards, whereby clip dragged = same content dropped regardless of Timeline settings, then please give us the option of turning off CC's new drag/dropping behavior through a new check box option in the Preferences Window: "Source patching affects Drag/dropping".
    Checked = CC behavior
    Unchecked = CS6 behavior
    Why is this feature important to you?
    Because respecting workflows matters!  CS6 and prior Premiere editors had their workflows disrespected when Adobe suddenly changed drag/dropping behavior with zero apparent benefits in return.  Please give us a choice in this matter or revert to CS6's intelligent drag-dropping altogether.

    I posted this first FR at the end of another thread, here.  Due to the importance of this issue, IMO, I'm giving this FR a new thread, plus adding as second version of the same FR.
    My stance is simple.  Every change Adobe makes to Premiere Pro should be positive to most or all people.  If a change Adobe makes is negative for most or all people, then it must be removed.
    Adobe did a negative change in CC, which brings about zero positive improvements (unless proven otherwise which has not been done yet).
    In CC, drag-dropping clips no longer  = dropping what you're dragging!  If you only have a video track source patched, audio doesn't get dragged to the Timeline.  If you only have an audio track source patched, video doesn't get dragged to the Timeline.
    This is contrary to the way it worked in CS6 (where it made sense): drag drop clip = same clip dropped, regardless of Timeline settings!
    Please help fix this by sending the following FRs as your own or writing a FR of your own based on this new problem Adobe introduced in CC.  Thank you and God bless all those that care enough about Premiere to take action!
    VERSION 1 (revert back to CS6)
    *******Enhancement / FMR*********
    Brief title for your desired feature:
    Drag/Dropping video with audio clip from Source Monitor or Project window to Timeline should include both video and audio... always!
    How would you like the feature to work?
    The way it did in Premiere Pro CS6: 
    A. Video with audio dragged from Project window = video with audio dropped in Timeline
    B. Three drag/dropping options from Source monitor, regardless of Source Patch settings.  Drag/drop:
    1. Source Monitor Image = Video + Audio
    2. 'Drag Video Only' button = Video only
    3. 'Drag Audio Only' button = Audio only
    In CC, these options no longer work properly depending on Source Patching.  This makes no sense, and provides zero benefits to the editor!
    Why is this feature important to you?
    Because intelligent workflows matter!  There's nothing intelligent or efficient about the Source Monitor's buttons working some times but not others, or drag/dropping a clip from the Project window only to find its audio doesn't appear in the Timeline.  When drag and dropping clips, Source Patching should determine default clip PLACEMENT, Not WHAT gets dragged to the Timeline!
    VERSION 2 (give us a choice!)
    *******Enhancement / FMR*********
    Brief title for your desired feature: Preferences window option to disable Source Patching's effect on drag/dropped clips.
    How would you like the feature to work?
    If Adobe can't/won't revert drag/dropping back to functional CS6 standards, whereby clip dragged = same content dropped regardless of Timeline settings, then please give us the option of turning off CC's new drag/dropping behavior through a new check box option in the Preferences Window: "Source patching affects Drag/dropping".
    Checked = CC behavior
    Unchecked = CS6 behavior
    Why is this feature important to you?
    Because respecting workflows matters!  CS6 and prior Premiere editors had their workflows disrespected when Adobe suddenly changed drag/dropping behavior with zero apparent benefits in return.  Please give us a choice in this matter or revert to CS6's intelligent drag-dropping altogether.

  • Able to drag drop items of combobox but want to disable 1st item

    Hello Sir,
    I am able to drag drop elements of the combobox.
    Here is my code...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:local="*" xmlns:utils="adobe.utils.*" xmlns:controls="qs.controls.*" initialize="init()">
    <mx:Script>
    <![CDATA[
    import mx.events.DragEvent;
    import mx.events.ListEvent;
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.controls.ComboBox;
    import mx.controls.Alert;
    [Bindable]
    public var str:String = "";
    public var comboLength:int;
    public function init():void
    var xml:XML = <test>
    <col>
    <col1>one</col1>
    </col>
    <col>
    <col1>two</col1>
    </col>
    <col>
    <col1>three</col1>
    </col>
    <col>
    <col1>four</col1>
    </col>
    <col>
    <col1>five</col1>
    </col>
    <col>
    <col1>six</col1>
    </col>
    <col>
    <col1>seven</col1>
    </col>
      </test>;
      cb1.dataProvider = xml;
      comboLength = xml.col.length();
      cb1.rowCount = comboLength;
      str = (xml.col[0].col1.toString());
      cb1.prompt = str;
    public function closeHandler(event:Event):void
    if(MouseEvent.DOUBLE_CLICK)
    // Alert.show("Click Event");
    public function changeHandler(event:ListEvent):void
    // Alert.show("Single Click Event");
    public function doubleClickEvent(event:MouseEvent):void
    Alert.show(event.currentTarget.toString());
    Alert.show(event.target.toString(),"Double Click");
    public function dragEnterFunction(event:DragEvent):void
    Alert.show(event.target.parent.toString());
    ]]>
    </mx:Script>
    <mx:ComboBox id="cb1" prompt="prashant" doubleClickEnabled="true" doubleClick="doubleClickEvent(event)"
    close="closeHandler(event)" dragEnter="dragEnterFunction(event)" >
    <mx:itemRenderer>
    <mx:Component>
    <mx:DataGrid itemClick="outerDocument.cb1.text = this.selectedItem.col1.toString();itemSelected(event)"
    dragEnabled="true" dropEnabled="true" dragDrop="draDropHandler(event)" dragMoveEnabled="true" headerHeight="0" showHeaders="false"
    creationComplete="init()" click="clickable()"
    itemDoubleClick="doubleClickEvent(event)">
    <mx:columns>
    <mx:DataGridColumn dataField="col1" headerText="" id="da" disabledColor="white"  />
    </mx:columns>
    <mx:Script>
    <![CDATA[
    import mx.controls.DataGrid;
    import mx.events.DropdownEvent;
    import mx.events.ListEvent;
    import mx.events.DragEvent;
    import mx.controls.Label;
    import mx.controls.Alert;
    public function clickable():void
    //Alert.show("clickable");
    public function itemSelected(event:ListEvent):void
    Alert.show(event.itemRenderer.data.col1,"Single Click");
         public function draDropHandler(event:Event):void
    Alert.show(event.target.parent.toString());
    public function dragEnterFunction(event:DragEvent):void
    Alert.show(event.target.parent);
    override public function set data( value:Object ) : void
    this.dataProvider = value.col;
    //outerDocument.cb1.text = this.selectedItem.col1.toString()
    //myList.addEventListener(ListEvent.ITEM_DOUBLE_CLICK, onItemDoubleClick,
    public function doubleClickEvent(event:ListEvent):void
    Alert.show(event.itemRenderer.data.col1,"Double Click");
    ]]>
    </mx:Script>
    </mx:DataGrid>
    </mx:Component>
    </mx:itemRenderer>
    </mx:ComboBox>
    </mx:Application>
    But now i want to disable drag drop of the 1st item and the last item.
    And also add double click of each item.
    Can someone please help me out.
    Awaiting your reply.
    Thanks in advance.

    Hello Sir,
    Thanks a lot for your reply.
    I have implemented some thing can you please help me out with this?
    In this can you help me out with the double click event????
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
    xmlns:local="" xmlns:utils="adobe.utils." xmlns:controls="qs.controls.*"
    initialize="init()">
    <mx:Script>
    <![CDATA[
    import mx.events.DragEvent;
    import mx.events.ListEvent;
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.controls.ComboBox;
    import mx.controls.Alert;
    import mx.controls.listClasses.ListBase;
    import mx.core.UIComponent;
    public var str:String = "";
    public var comboLength:int;
    public function init():void
    var xml:XML =
    </mx:Application

  • Drag & Drop of a file not working in Ubuntu & other linux

    Hi All,
    I am working on a project,in which it has the requirement of dragging the files
    from a JList present inside a JFrame to the desktop.
    First I tried to get a solution using dnd API but could not. Then i googled and i got an application which is
    working perfectly in both Windows and MAC Operating systems, after I made few minor changes to suit my requirements.
    Below is the URL of that application:
    http://stackoverflow.com/questions/1204580/swing-application-drag-drop-to-the-desktop-folder
    The problem is the same application when I executed on Ubuntu, its not working at all. I tried all available options but could not trace out the exact reason.
    Can anybody help me to overcome this issue?
    Thanks in advance

    Hi,
    With the information you provided and through some information found on google i coded an application. This application is able to do the drag and drop of an item from the Desktop to Java application on Linux Platform, but i am unble to do the viceversa by this application.
    I am including the application and the URL of the information i got.
    [URL Of Information Found|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4899516]
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.datatransfer.DataFlavor;
    import java.awt.datatransfer.Transferable;
    import java.awt.datatransfer.UnsupportedFlavorException;
    import java.awt.dnd.DropTarget;
    import java.awt.dnd.DropTargetDragEvent;
    import java.awt.dnd.DropTargetDropEvent;
    import java.awt.dnd.DropTargetEvent;
    import java.awt.dnd.DropTargetListener;
    import java.io.File;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    import javax.swing.DefaultListModel;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JScrollPane;
    import javax.swing.SwingUtilities;
    import javax.swing.TransferHandler;
    import javax.swing.WindowConstants;
    public class DnDFrame extends JFrame implements DropTargetListener {
         private DefaultListModel listModel = new DefaultListModel();
         private DropTarget dropTarget;
         private JLabel jLabel1;
         private JScrollPane jScrollPane1;
         private JList list;
         List<File> files;
         /** Creates new form DnDFrame */
         public DnDFrame() {
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              initComponents();
              dropTarget = new DropTarget(list, this);
              list.setModel(listModel);
              list.setDragEnabled(true);
              list.setTransferHandler(new FileTransferHandler());
         @SuppressWarnings("unchecked")
         private void initComponents() {
              GridBagConstraints gridBagConstraints;
              jLabel1 = new JLabel();
              jScrollPane1 = new JScrollPane();
              list = new JList();
              setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              getContentPane().setLayout(new GridBagLayout());
              jLabel1.setText("Files:");
              gridBagConstraints = new GridBagConstraints();
              gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
              gridBagConstraints.anchor = GridBagConstraints.WEST;
              getContentPane().add(jLabel1, gridBagConstraints);
              jScrollPane1.setViewportView(list);
              gridBagConstraints = new GridBagConstraints();
              gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
              gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
              getContentPane().add(jScrollPane1, gridBagConstraints);
              pack();
         public void dragEnter(DropTargetDragEvent arg0) {
         public void dragOver(DropTargetDragEvent arg0) {
         public void dropActionChanged(DropTargetDragEvent arg0) {
         public void dragExit(DropTargetEvent arg0) {
         public void drop(DropTargetDropEvent evt) {
              System.out.println(evt);
              int action = evt.getDropAction();
              evt.acceptDrop(action);
              try {
                   Transferable data = evt.getTransferable();
                   DataFlavor uriListFlavor = null;
                   try {
                        uriListFlavor = new DataFlavor("text/uri-list;class=java.lang.String");
                   } catch (ClassNotFoundException e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                   System.out.println("data.isDataFlavorSupported(DataFlavor.javaFileListFlavor: " +
                             data.isDataFlavorSupported(DataFlavor.javaFileListFlavor) );
                   if (data.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
                        files = (List<File>) data.getTransferData(DataFlavor.javaFileListFlavor);
                        for (File file : files) {
                             listModel.addElement(file);
                   }else if (data.isDataFlavorSupported(uriListFlavor)) {
                        String data1 = (String)data.getTransferData(uriListFlavor);
                        files = (List<File>) textURIListToFileList(data1);
                        for (File file : files) {
                             listModel.addElement(file);
                        System.out.println(textURIListToFileList(data1));
              } catch (UnsupportedFlavorException e) {
                   e.printStackTrace();
              } catch (IOException e) {
                   e.printStackTrace();
              } finally {
                   evt.dropComplete(true);
         private static java.util.List textURIListToFileList(String data) {
              java.util.List list = new java.util.ArrayList(1);
              for (java.util.StringTokenizer st = new java.util.StringTokenizer(data,"\r\n");
              st.hasMoreTokens();) {
                   String s = st.nextToken();
                   if (s.startsWith("#")) {
                        continue;
                   try {
                        java.net.URI uri = new java.net.URI(s);
                        java.io.File file = new java.io.File(uri);
                        list.add(file);
                   } catch (java.net.URISyntaxException e) {
                   } catch (IllegalArgumentException e) {
              return list;
         private class FileTransferHandler extends TransferHandler {
              @Override
              protected Transferable createTransferable(JComponent c) {
                   JList list = (JList) c;
                   List<File> files = new ArrayList<File>();
                   for (Object obj: list.getSelectedValues()) {
                        files.add((File)obj);
                   return new FileTransferable(files);
              @Override
              public int getSourceActions(JComponent c) {
                   return COPY;
         static {
              try {
                   uriListFlavor = new
                   DataFlavor("text/uri-list;class=java.lang.String");
              } catch (ClassNotFoundException e) {
                   e.printStackTrace();
         private class FileTransferable implements Transferable {
              private List<File> files;
              public FileTransferable(List<File> files) {
                   this.files = files;
              public DataFlavor[] getTransferDataFlavors() {
                   return new DataFlavor[]{DataFlavor.javaFileListFlavor,uriListFlavor};
              public boolean isDataFlavorSupported(DataFlavor flavor) {
                   if(flavor.equals(DataFlavor.javaFileListFlavor) || flavor.equals(uriListFlavor))
                        return true;
                   else
                        return false;
              public Object getTransferData(DataFlavor flavor) throws
              UnsupportedFlavorException, java.io.IOException {
                      if (isDataFlavorSupported(flavor) && flavor.equals(DataFlavor.javaFileListFlavor)) {
                        return files;
                   }else if (isDataFlavorSupported(flavor) && flavor.equals(uriListFlavor)) {
                        java.io.File file = new java.io.File("file.txt");
                        String data = file.toURI() + "\r\n";
                        return data;
                   }else {
                        throw new UnsupportedFlavorException(flavor);
         private static DataFlavor uriListFlavor;
         static {
              try {
                   uriListFlavor = new
                   DataFlavor("text/uri-list;class=java.lang.String");
              } catch (ClassNotFoundException e) {
                   e.printStackTrace();
         public static void dumpProperty(String name) {
              System.out.println(name + " \t" + System.getProperty(name) );
         public static void main(String[] args) {
              String[] props = {
                        "java.version",
                        "java.vm.version",
                        "java.vendor",
                        "os.name",
              "os.version"};
              for (String prop : props) {
                   dumpProperty(prop);
              Runnable r = new Runnable() {
                   public void run() {
                        DnDFrame f = new DnDFrame();
                        f.setVisible(true);
              SwingUtilities.invokeLater(r);
    }Please Suggest me in this.

  • Drag & drop albums not working in iphoto

    I am using iphoto 11 version 9.4.2  I used to be able to drag & drop my albums into a preferred order.  Now when I try to move a particular album within the album section by dragging & dropping, a new folder is created containing the album I was trying to move.  How can I move albums into a particular order.  Why are folders being created when I try to move albums?

    I'm able to sort albums both way, inside folders and those out of folders. The feature exists.  As a test launch iPhoto with the Option key held down and create a new, test library.  Import some photos, create a number of albums and albums in a folder and test to see if the same problem persists. Does it?  I'm running iPhoto 9.4.3 on 10.8.4.
    OT

  • No "Ringtones" tab and can't drag & drop ringtones into iTunes

    I have an iPhone4 running OS4.3, using iTunes 10.2 on a Windows Vista PC. I used an iPhone app to create custom ringtones, and have followed the app's instructions to save the ringtones to my PC and then copy into iTunes. Two problems:
    1) The instructions say to drag & drop the .m4r files into iTunes. I've seen this mentioned in other posts on this topic. When I try to do this, the files won't "drop". I see the "no" symbol (circle with line) when I hover over my music library.
    2) The instructions say to click on my iPhone in iTunes, and then on the "Ringtones" tab along the top of the screen. I don't have a Ringtones tab. There's also no reference to Ringtones in the left navigation pane.
    How do I correct this?
    Thanks

    !!! JUST DOWNGRADE YOUR ITUNES VERSION, AND USE THE OLDER ONE - THAT'S ALL. SORRY FOR ALL-CAPITAL LETTERS AND EXCLAMATION MARKS, - IT IS JUST OUT OF EXCITEMENT, AFTER HOURS OF SEARCHING AND THINKING ABOUT A SOLUTION !!!
    Shalom all,
    Our frustration and pain is over, for sure… With some help and hints from this forum I’ve found a precise solution to the above mentioned can’t-get-the-goddamned-ringtones-tab-to-appear-in-my-iTunes problem.
    Now let me try and get up to the point:
    The 10.5.2 version of iTune is worthless (at least, it’s 64-bit modification, which I’ve been using up to this point). By reading a few comments on your forum, I’ve quickly decided to try and downgrade to 10.4.1.10 version (seems to me, 64-bit), which can be downloaded from apple.com site with just a little extra-search.
    By the way, I do have Windows 7 64-bit OS on my PC, and “Apple” warns that one MUST use 64-bit installation in my case…
    One must uninstall previously installed 10.5.2 (if there used to be one, of course). In such a case, please, also uninstall a “Bonjour” program by “Apple” (don’t know what’s that, but you will not be able proceed any further with, as it was said in my case, higher version of “Bonjour” left behind).
    After uninstalling those two abovementioned things, I have installed iTunes 10.4.1.10 , even without being asked for reboot by the end of the installation. But, alas, when I tried running iTunes, it failed with the complain about a “iTunes Library.itl” file (found in C:\Users\<My_User>\Music\iTunes). I’ve just renamed the file (could’ve been removed as well, of course) and restarted the iTunes. This time everything went smooth.
    The rest of the story, I assume, you can imagine much better than me. Go to Edit->Preferences and tick “Ringtones”. After connecting the iPhone (well, probably one more iTunes restart will be required in this case, - not sure about that), we will get the “Ringtones” tab set also under the iPhone definition (see “DEVICES” in iTunes).
    Next, create an .m4a file out of your favorite ringtone, move it to the Desktop, change the extension to a4r, add it back (drug-and-drop) to “Ringtones” tab at the iTunes LIBRARY. Then make some blessing, take a deep breath and… that’s pretty much done. One important thing not to forget before sync: click on your phone (under iTune’s DEVICES), and click on “Ringtones”, located right under the gorgeous :-) apple picture in the top middle of the iTunes window. Mark “Sync Ringtones” and “All Ringtones” (?) there, of course…
    BTW, no need whatsoever to register your phone, - you can just postpone the registration...
    Phew… Let’s hope I haven’t forget anything. Anyhow, the idea was to get rid of iTunes 10.5.2 as soon as possible, uninstall it together with “Bonjour” (say good bye to “Bonjour”  ), then install a good old iTunes 10.4.1.10, get over few problems and… The rest of the procedure - you know it by heart, by far better than me…
    I’ve been struggling with the problem for less than a day (thanks to all of you, pals), but I can imagine there are still some poor pal chaps around…
    Let us help them… Very unfortunately, English is not my mother tongue, as you can see… I wish, it would be different, but G-d decided other way… Please, (1) make some corrections and clarifications to this notes (I could've made it better, but in a crunch now, really), and also, (2) try spreading it among as many guys as possible… If you can pass this solution to “Apple” tech support, - it should be taken to consideration...
    And I'll be waiting now for a generous job offer from that great company... :-)
    Let me just wish you all a very Happy New Year...
    Thank you all, dear friends, and do enjoy the best of your own FREE ringtones……
    P.S.: iTunes 10.4.1 (64-bit) can be found here http://support.apple.com/kb/DL1427 , at the bottom of the page...
    Message was edited by: leonidr321

  • Drag drop images while composing the forum post

    Hi All,
    Many time I felt like it would be good if we can drag drop images to the forum post being composed.  Similar to Gmail compose, if NI forum composition page also has that drag drop feature, it would be great.  But I'm wondering if it's only me or other people are also out there looking for this feature.
    Thanks,
    Ajay.

    Francois,
    I have tried to implement this bean but I'm having problems. I've been using your
    LAF package for almost 4 years now without issue. I tried the jar file from the zip
    file. I also created a new project and recompiled the java code against the 10.1.2.3
    frmall.jar file that matches our app server. I resigned it and it's still not working.
    Maybe I'm just missing something simple. When I compile and run the form, I see
    the canvas and I can change the text fields, but I don't see how I can drag and
    drop items. Hopefully, you can think of something that can fix our problem. I would
    love to be able to use drag and drop functionality in an upcoming application.
    We're running the following versions:
    App Server: 10.1.2.3
    DB: 10.2.0.5
    JDev: 10.1.3.3.0
    Windows XP for the clients
    Windows Server 2008 for the servers
    Thanks,
    Jason
    Edit: I looked in my java console and saw that my issue was that we signed this jar file with a different certificate. I created a special config as Francois has suggested in another post and included only the DnD.jar file and it worked. However, I can't get the image or multi-line text areas to drag and drop. I'll keep poking around and see if I can figure out what's going on. The console seems to recognize when I'm dragging and dropping from all fields.
    Edited by: hanszarkov on Jun 27, 2011 12:58 PM

  • Drag/Drop "Numbered Stills" from Explorer into Project?

    I only get individual stills when I drag a folder from Explorer into a project.  Is there a way to tell Premiere to import as numbered stills (ie a sequence) when using drag/drop?
    Thanks.

    Yes, there is an Adobe way that is MUCH better, but it is not exactly a Premiere Pro way
    1) Using Adobe Bridge, put all of your stills in the order that you want them to show in Premiere
    2) Select all photos and do a right-click "batch rename" (set to make a copy of all photos with 001 002 003 numbers in front of each file name in an empty sub-directory)
    3) Import the whole "folder" (that you just "batch rename" copied the photos into) using the "import folder" option
    Hope this works for your "workflow" as well as it does for mine.
    Regards,
    Jim

Maybe you are looking for