How to drag and drop image between Windows platform and VM

Thanks.

Hi Deer2000,
There are several things you need to do first. You need a Transferable that can provide the image data in a format that the application likes. You will not be able to drop a serialized ImageIcon onto a native app for example. Most won't accept a binary stream even if you declare it's MIME type (e.g. image/jpeg) either.
You need to know what the native "clipboard" formats are. For example on Win32, DIB (device independent bitmap) and BITMAP are clipboard image formats. Learn the format and write an InputStream the can provide it. Then add your stream to a FlavorMap.
What is a FlavorMap and why do I need one?
Most native apps don't understand MIME types for data transfer. They have their own "clipboard" types. Java DataFlavors are based on MIME types. In order to provide a mapping between the win32 format TEXT and MIME types text/plain;charset=ascii you create a FlavorMap. Actually the default system flavormap does this type for you.
An easy way to add mappings is to edit $JDKHOME/jre/lib/flavormap.properties. For our custom image stream we've added the following entry:
DIB=image/x-win-bmp;class=com.rockhoppertech.dnd.datatransfer.BitmapInputStream
Other Win32 clipboard formats are:
WAVE
RIFF
PALETTE
ENHMETAFILE
METAFILEPICT
DIB
TIFF
Or please refer this URL, which gives a good idea about drag and drop in Java
http://www.rockhoppertech.com/java-drag-and-drop-faq.html
I hope this will help you.
Thanks
Bakrudeen

Similar Messages

  • How to drag and drop between portlets?

    Howdy!
    Could someone please be kind enough to show me how to drag and drop data between portlets. I want to select an icon, drag it to an application and launch the file associated with the icon in the application.
    I can do it within a portlet with some js functions but when I try it between portlets (on the same page)I see the forbiden sign.
    Thanks
    Jeff Graber

    Hi
    thanks for the advice. However, that is what I had done. Here is the code in the jsp file for the destination portlet and it does not work. If you have any ideas, thanks!
    <%@ page language="java" contentType="text/html;charset=UTF-8"%>
    <%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
    <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
    <%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
    <netui:html>
    <head>
    <title>
    MS Word Portlet
    </title>
              <script language="JavaScript" src="../js/common.js"></script>
              <script language="JavaScript" src="../js/containers.js"></script>
              <script language="JavaScript" src="../js/document.js"></script>
    </head>
    <body>
    Application Village Portlet
    <p>TextOre
    | <a id="MS Word" ondrop="sendInfo(this.id)" ondragover="fnCancelDefault()"><img src="/Jime/images/WORDY.gif" alt="Drag one or more documents here to open with MS Word" border="0"></img></a>
    | <a id="MS Excel" ondrop="sendInfo     (this.id);" ondragover="fnCancelDefault()"><img src="/Jime/images/EXCELY.gif" alt="Drag one or more documents here to open with MS Excel" border="0"></img></a>
    | <a id="MS PowerPoint" ondrop="sendInfo(this.id);" ondragover="fnCancelDefault()"><img src="/Jime/images/PowerPointY.gif" alt="Drag one or more documents here to open with MS PowerPoint" border="0"></img></a>
    | <a id="Trash" ondrop="sendInfo(this.id);" ondragover="fnCancelDefault()"><img src="/Jime/images/trashcan.gif" alt="Drag one or more documents here to delete" border="0"></img></a>
    </body>
    </netui:html>

  • How to drag and drop a picture at run time in a window displaying pictures?

    How to drag and drop a picture at run time in a window displaying pictures on the front panel. The main thing is that the window is displaying frames continuously?

    vivman,
    So from your description you have a picture control where you've already created an image and you'd like to drag an image around inside of the picture control. This can be done although it is going to take a significant amount of research and programming on your behalf. You can use the drag event in the event handler to find out when the drag occurs and where the cursor is. Then edit the picture as you move your mouse so that when you drop the picture gets updated.
    The even structure is a somewhat advanced topic and the drag and drop feature is one of the more advanced uses of this structure. I would search the example finder (help>>find examples) for "event" and "drag" to see how to use these events. Also you'll want to look at the examples for the picture control.
    Sounds like a cool project! Check out Darren's Weekly Nugget 10/30/2006 this topic (http://forums.ni.com/ni/board/message?board.id=170&message.id=212920). It might prove useful.
    Good luck!
    Chris C
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect

  • How to drag and drop tab nodes between tab panes

    I'm working on example from this tutorial( Drag-and-Drop Feature in JavaFX Applications | JavaFX 2 Tutorials and Documentation ). Based on the tutorial I want to drag tabs between two tabs. So far I managed to create this code but I need some help in order to finish the code.
    Source
    tabPane = new TabPane();
    Tab tabA = new Tab();
       Label tabALabel = new Label("Main Component");
    tabPane.setOnDragDetected(new EventHandler<MouseEvent>()
                @Override
                public void handle(MouseEvent event)
                    /* drag was detected, start drag-and-drop gesture*/
                    System.out.println("onDragDetected");
                    /* allow any transfer mode */
                    Dragboard db = tabPane.startDragAndDrop(TransferMode.ANY);
                    /* put a string on dragboard */
                    ClipboardContent content = new ClipboardContent();
                    content.put(DataFormat.PLAIN_TEXT, tabPane);
                    db.setContent(content);
                    event.consume();
    What is the proper way to insert the content of the tab as object? Into the tutorial simple text is transferred. How I must modify this line content.put(DataFormat.PLAIN_TEXT, tabPane);?
    And what is the proper way to insert the tab after I drag the tab:
    Destination
    tabPane.setOnDragDropped(new EventHandler<DragEvent>()
                @Override
                public void handle(DragEvent event)
                    /* data dropped */
                    /* if there is a string data on dragboard, read it and use it */
                    Dragboard db = event.getDragboard();
                    boolean success = false;
                    if (db.hasString())
                        //tabPane.setText(db.getString());
                        Tab tabC = new Tab();
                        tabPane.getTabs().add(tabC);
                        success = true;
                    /* let the source know whether the string was successfully
                     * transferred and used */
                    event.setDropCompleted(success);
                    event.consume();
    I suppose that this transfer can be accomplished?
    Ref javafx 2 - How to drag and drop tab nodes between tab panes - Stack Overflow

    I would use a graphic (instead of text) for the Tabs and call setOnDragDetected on that graphic. That way you know which tab is being dragged. There's no nice way to put the Tab itself into the dragboard as it's not serializable (see https://javafx-jira.kenai.com/browse/RT-29082), so you probably just want to store the tab currently being dragged in a property.
    Here's a quick example; it just adds the tab to the end of the current tabs in the dropped pane. If you wanted to insert it into the nearest location to the actual drop you could probably iterate through the tabs and figure the coordinates of each tab's graphic, or something.
    import java.util.Random;
    import javafx.application.Application;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.Tab;
    import javafx.scene.control.TabPane;
    import javafx.scene.input.ClipboardContent;
    import javafx.scene.input.DragEvent;
    import javafx.scene.input.Dragboard;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.input.TransferMode;
    import javafx.scene.layout.StackPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class DraggingTabPane extends Application {
      private static final String TAB_DRAG_KEY = "tab" ;
      private ObjectProperty<Tab> draggingTab ;
    @Override
      public void start(Stage primaryStage) {
      draggingTab = new SimpleObjectProperty<>();
      TabPane tabPane1 = createTabPane();
      TabPane tabPane2 = createTabPane();
      VBox root = new VBox(10);
      root.getChildren().addAll(tabPane1, tabPane2);
      final Random rng = new Random();
      for (int i=1; i<=8; i++) {
        final Tab tab = createTab("Tab "+i);
        final StackPane pane = new StackPane();
          int red = rng.nextInt(256);
          int green = rng.nextInt(256);
          int blue = rng.nextInt(256);
        String style = String.format("-fx-background-color: rgb(%d, %d, %d);", red, green, blue);
        pane.setStyle(style);
        final Label label = new Label("This is tab "+i);
        label.setStyle(String.format("-fx-text-fill: rgb(%d, %d, %d);", 256-red, 256-green, 256-blue));
        pane.getChildren().add(label);
        pane.setMinWidth(600);
        pane.setMinHeight(250);
        tab.setContent(pane);
        if (i<=4) {
          tabPane1.getTabs().add(tab);
        } else {
          tabPane2.getTabs().add(tab);
      primaryStage.setScene(new Scene(root, 600, 600));
      primaryStage.show();
      public static void main(String[] args) {
      launch(args);
      private TabPane createTabPane() {
        final TabPane tabPane = new TabPane();
        tabPane.setOnDragOver(new EventHandler<DragEvent>() {
          @Override
          public void handle(DragEvent event) {
            final Dragboard dragboard = event.getDragboard();
            if (dragboard.hasString()
                && TAB_DRAG_KEY.equals(dragboard.getString())
                && draggingTab.get() != null
                && draggingTab.get().getTabPane() != tabPane) {
              event.acceptTransferModes(TransferMode.MOVE);
              event.consume();
        tabPane.setOnDragDropped(new EventHandler<DragEvent>() {
          @Override
          public void handle(DragEvent event) {
            final Dragboard dragboard = event.getDragboard();
            if (dragboard.hasString()
                && TAB_DRAG_KEY.equals(dragboard.getString())
                && draggingTab.get() != null
                && draggingTab.get().getTabPane() != tabPane) {
              final Tab tab = draggingTab.get();
              tab.getTabPane().getTabs().remove(tab);
              tabPane.getTabs().add(tab);
              event.setDropCompleted(true);
              draggingTab.set(null);
              event.consume();
        return tabPane ;
      private Tab createTab(String text) {
        final Tab tab = new Tab();
        final Label label = new Label(text);
        tab.setGraphic(label);
        label.setOnDragDetected(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            Dragboard dragboard = label.startDragAndDrop(TransferMode.MOVE);
            ClipboardContent clipboardContent = new ClipboardContent();
            clipboardContent.putString(TAB_DRAG_KEY);
            dragboard.setContent(clipboardContent);
            draggingTab.set(tab);
            event.consume();
        return tab ;

  • How to drag and drop to desktop

    Hi experts,
    please see the following scenario:
    - We created a report using xCelsius that is technically a Flash file (SWF)
    - We included this into an iView
    Is there a possibility to drag and drop it to the Windows Desktop (e.g. Pressing the left mouse button and release it on the Desktop as it works for simple images)?
    Best Regards and thanks for your help.
    Thomas

    Hi,
    You cannot drag n drop flash to Windows desktop.
    Regards,
    Praveen Gudapati

  • How to drag and drop a object in an indicator at run time?

    How to drag and drop a picture at run time in a indicator displaying pictures on the front panel. The main thing is that the window is displaying frames continuously?

    Hi Vivman,
    You have duplicated this post here. Please do not post the same question to separate forum post.
    Cheers.
    | Michael K | Project Manager | LabVIEW R&D | National Instruments |

  • How to drag and drop the af:inputNumberSpinbox in the control panel

    Hi,
    I am using jdev 11.1.1.4.0
    I need the component as <af:inputNumberSpinbox> . Create a data model and how to drag and drop as inputNumberSpinbox in the data control.
    normally drog and drop the particular attribute as inputText box only. I want <af:inputNumberSpinbox>.
    anythig want to change in the view object control hints itself. help me.
    Regards,
    ragupathi S.
    Edited by: Ragu on Jun 22, 2011 4:45 PM

    Hi,
    Can't you drop it as an inputText and then change it in the source to inputNumberSpinbox?
    Regards,
    Stijn.

  • How to drag and drop another swf or fla into a template?

    I am building a flash website for a friend. We are using templates he purchased at flashden.net.
    I normally use wordpress, joomla and other such systems and am familiar with html, php, cgi and such.
    This is my first time dealing with a flash template.
    I have downloaded the trial version of the software and he wants to purchase adobe flash professional for me
    So that we can edit the template and add features he wants in the future.
    The website that sells the templates says you can easily drag and drop addons to templates in flash
    but I am not finding it so easy. Is there somewhere online where I can find a tutuorial on how to step by step
    drag and drop flash files into another template etc.?
    Also, where can I find good tutorials in general? I have downloaded adobe flash for dummies it is not as indepth as I need
    to get a handle on this software.
    Thank you to anyone that offers me any advice,
    David Doherty

    Ned,
    Thank you for responding.
    Flashden.net does claim its a simple drag and drop operation to do this but they have little to know information on the site about the subject and
    having difficulty with the sellers on step by step instructions. They claim it's easy it may be.
    The person I am building the website for had a bad experience with one of the sellers who refused to offer anything but basic instructions and claimed the cost of the software was not worth his time.
    Here are the instructions that were provided:
      Open news_rotator.fla
      Go to library.
      Select and copy NewsRotator movie clip.
      Paste it into your own project’s library.
      Now, you can drag and drop it into your own movie clips.
      Use news.xml to add/remove headlines.
    As you can see from what your telling me this is insufficent information on how to drag and drop this flash into another flash template.
    I will attempt to contact other selers at flashden for information as I have other flash templates we have purchased.
    Thank you,
    David Doherty

  • How to drag and drop user from one node to other node.

    Dear All,
    How to drag and drop user from one node to other node.I tried but no success.
    What are precautions to be taken.
    Cay anybody kindly explain it.
    Thank you.

    Hello, if you had this message you had created BP....
    Now you don't have to user USERS_GEN this transaction is used only in first action, when you create the user in R/3 and then you pass this user to EBP in the organizational structure.
    Now you have to:
    1) Go to PPOMA_BBP
    2) Double click on organizational unit that you want to put this user (purchasing organization or purchasing group box for example)
    3) Select assign button in the top of the functions in the transaction
    4) Click on incorporates -- position
    5) Put userID that you want to add in this organizational unit
    6) Click Save
    Thanks
    Rosa

  • Can anyone tell me how to drag and drop music to my ipod with the new version of itunes?

    yeah, so this new update *****.
    just hoping someone can tell me how to drag and drop my music onto my ipod like we used to be able to do in the old versions of itunes. THANKS!

    I haven't used it myself, but I've heard about this app.
    http://plumamazing.com/mac/iwatermark
    The are also a bunch in the App store.
    Matt

  • [svn:fx-3.x] 11192: In AIR, you can drag' n drop text between text components like TextInput and TextArea.

    Revision: 11192
    Author:   [email protected]
    Date:     2009-10-27 12:54:37 -0700 (Tue, 27 Oct 2009)
    Log Message:
    In AIR, you can drag'n drop text between text components like TextInput and TextArea.  There's an AIR bug where doing so doesn't result in a TEXT_INPUT or a CHANGE event.  This is a workaround for that bug so that we listen for a nativeDragDrop event.
    QE notes: -
    Doc notes: -
    Bugs: SDK-19816
    Reviewer: Gordon
    Tests run: checkintests, mustella TextInput, TextArea
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-19816
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/controls/TextArea.as
        flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/controls/TextInput.as

    First 3 .as are the component
    source. in the last test.mxml file i have written the drag and drop functionality.
    can any help me?? please

  • Drag n Drop image along with the ability to resize the image in hbox

    Hi All,
    Is there an application similar to paint where we can drag n drop images and also resize them in javafx application? and also can we draw a line and also resize it?
    Thank You
    Edited by: SathyaRao on Jun 3, 2012 3:08 AM
    Edited by: SathyaRao on Jun 3, 2012 6:49 AM

    Hello sathyaRao,
    I don't think there is anything like that . You need to develop by yourself . I've written some blog post which might be related with your requirement.
    - Draggable Node in Javafx 2.0
    - JavaFX Drag and Drop Cell in ListView
    For more please do some google on keywords like : javafx,drag,drop etc
    FYI: Documentation of JavaFX 2
    Thanks,
    Narayan

  • How to drag and move duplicated movieclip in flashMX

    i would like to know how to drag and move duplicated movie
    clip in flashMX? i'm unable to drag and move duplicated movieclips
    but able to see duplicated movieclip on the stage. Is there anyone
    who can show me or direct me to any tutorial site?
    Thanks

    i have just changed to Flash MX2004 and below is my code. I'm
    not sure what has gone wrong with my script as i still unable to
    drag my duplicated movieclip? hope u guys can help me out!
    var mySelection = "";//Global declaration
    var totalmc = 0;
    wire.onPress = function ()
    this.createEmptyMovieClip(["mc"+totalmc],
    this.getNextHighestDepth(["mc"+totalmc])); //Create a newMovieClip
    with variable name "mc1""
    duplicate(["mc"+totalmc]);
    //trace(["mc"+totalmc]);
    dragging(["mc"+totalmc]);
    mc = attachMovie("idwire", ["wire"+totalmc++],
    this.getNextHighestDepth(["wire"+totalmc])); //store the Movie into
    mc1 by attaching
    mc._x = 273;//(Stage.width - mc1._width)/2;
    mc._y = 196.5;//(Stage.height - mc1._height)/2; //setting
    the corrdinates for x and y axis
    dragging(["wire"+totalmc]); //calling the dragging function
    //trace(mc1._width +","+ mc1._height);
    //Function for dragging
    function dragging()
    mc.onPress = function()
    this.startDrag(true);
    mySelection = this;
    mc.onRelease = mc.onReleaseOutside = function()
    stopDrag();
    function duplicate()
    mc.duplicateMovieClip (["mc"+i], i);
    i++;
    //trace("mc"+i);
    //trace(x);
    //Btn function for flipping
    flip.onRelease = function()
    mySelection._rotation += 10;
    //Btn function for delete
    del.onRelease = function()
    mySelection.removeMovieClip();

  • How to configure apache for ssl in windows platform

    hi all,
    can anyone help me expalin how to configure apache for ssl in windows platform.

    George,
    I would take the following 'first steps'
    1)Install Apache20 on your Windows machine following the Apache online documentation
    http://httpd.apache.org/docs-2.0/misc/tutorials.html
    2)Make sure you can 'serve up' static HTML content from your Apache Server
    3)Install Weblogic Server per our online documentation
    http://edocs.bea.com/wls/docs61/install/index.html
    4)Also, make sure you can 'serve up' both static and dynamic (e.g., JSP) content
    directly from WLS server
    5)Once you have both of the above 'sanity' checks attempt to configure a simple
    proxy by ppath or mime type via our online documentation
    http://edocs.bea.com/wls/docs61/adminguide/apache.html#103803
    Chuck Nelson
    DRE
    BEA Technical Support

  • How to disabled ctrl+alt+del on window platform

    Dear all,
    I am a java developer, I'm from cambodia, I don't know how to disabled ctrl+alt+dle on windows platform. can any one helps me to solve this problem. I hope all of you can do it. thanks for your kindness.
    Somongkol.chim

    There used to be a win32 call for it, so if you want it you'll need to go back to C/C++ and do JNI, provided it is still in the API.

Maybe you are looking for

  • How to see results for surveys in CIC Interaction record under script prfl?

    Dear Experts, In Interaction Record>Under Script tab> I have filled a survey-> upon entering all answers and saving->System showing a message, that survey has been sucessfully saved. But I dont know where these surveys are getting stored. and I could

  • Installing oracle 9i database in windows x 64 bit version

    Friends, I face difficulties in installing oracle 9i database in windows x 64 bit version 2003 server. The same had worked well with 32 bit version. I could install database and work in the same system in command prompt but the same could not be conn

  • Installing OS 10.5.4 On a 17" iMac intel

    Hi, I have an 17" iMac intel that had 10.4.11 installed on it. I am trying to install 10.5.4. I got to the Language screen , selected English. Hit continue. A window popped up stating, "This software cannot be installed on this computer." With OK and

  • Count(*) VS count(indexed_column_name)

    Hi, after a lot of reading here in the forum and the "ask tom" site, I can see that count(1) and count(*) are on the same, count(*) prove to be even faster sometimes. My question is: This is the same for indexed columns declared inside the count clau

  • Owner of the data on Activities

    Hi, how can I make confidential activities for user operating? For all documents I can do it  with "Data ownership authorization" I can not do it for activities. I tryed it, but I think it is not possible because on Activities there is not a field Ow