About Dragging  and Dropping

1-> I need to drag and drop a whole row or column within a same table.
how would i accomplish this in an applet.
2-> And also how can i store users personal table setting, so that next time when user logs in he can have the same view of the table.
Please help !
Thanks

i solved the problem my self. not very solid solution but it works fine.
t.addMouseListener( new MouseListener() {
          public void mouseClicked(MouseEvent e) {
          public void mousePressed(MouseEvent e) {
               Point p = e.getPoint();
               copyIndex = t.rowAtPoint(p);
               System.out.println("row from : "+copyIndex);
               stopThread();
          public void mouseReleased(MouseEvent e) {
               Point p = e.getPoint();
               pasteIndex = t.rowAtPoint(p);
               System.out.println("row to : "+pasteIndex);
     //Swapping rows value manually
               String temp[]=new String[colSize+1];
               for(int i=0;i<temp.length;i++)     
               {temp[i]=(String)t.getValueAt(pasteIndex,i);}
               for(int i=0;i<temp.length;i++)     
          { t.setValueAt(t.getValueAt(copyIndex,i),pasteIndex,i); }
          for(int i=0;i<temp.length;i++)     
               { t.setValueAt(temp[i],copyIndex,i); }
     //sending temporary row arrangement to servlet to get it permanent
               String rowArrangement="";
               for(int i=0;i<recSize;i++)
                    {  rowArrangement=rowArrangement+(String)t.getValueAt(i,0)+"*"; }
               try{     
                    wheretogo=1;
               AppletContext ac=getAppletContext();
                    URL url=getCodeBase();
                    ac.showDocument(new URL(url+"SaveRowArrangementServlet?Arrange="+rowArrangement));
                    }catch(Exception ex) {System.out.println(ex);}
          public void mouseEntered(MouseEvent e) {}
          public void mouseExited(MouseEvent e) {}
          );

Similar Messages

  • A question about drag and drop

    I have multiple images which can be dragged and dropped in a canvas. How can I get information about pictures into dataGrid, for instance the name and value (price) of an image? Currently my images are in array like this:
    private function init():void {
    currentExampleImage = imageExampleArray[imgExampleCurrentIndexNumber];
    private var imgExampleCurrentIndexNumber:Number = 0;
    private var imageExampleArray:Array =
    "assets/image1.png",
    "assets/image1.png"
    and they are run with loop like this:
    [Bindable] protected function get currentExampleImage():String {
        return _currentExampleImage;
    protected function set currentExampleImage(value:String) : void {
        _currentExampleImage = value;
    private function nextExampleImage(e:MouseEvent):void {
        if(imgExampleCurrentIndexNumber < imageExampleArray.length - 1)
        imgExampleCurrentIndexNumber++;
        currentExampleImage = imageExampleArray[imgExampleCurrentIndexNumber];
    else
        imgExampleCurrentIndexNumber = 0;
        currentExampleImage = imageExampleArray[imgExampleCurrentIndexNumber];
    So the question is that how can I set and get the name and the value of an image when it is dropped on a canvas and that information to be shown in a separate datagrid? Should I be using objects or classes? This is the drop function:
    private function doDragDrop(event:DragEvent):void
        var img:Image;
        if (event.dragInitiator.parent == whiteBoard)
            img = event.dragInitiator as Image;    
        else
            img = new Image();
            img.source = (event.dragInitiator as Image).source;
            img.addEventListener(MouseEvent.MOUSE_DOWN, doDragStart);
            whiteBoard.addChild(img);        
               img.x = event.localX - (event.dragSource.dataForFormat("localX") as Number);
               img.y = event.localY - (event.dragSource.dataForFormat("localY") as Number)
    Thanks beforehand and feel free to ask more information something is unclear.
    Message was edited by: SerpentChimera

    There's a separate empty datagrid in my application and the main intention is to make the information of each image (those dragged and dropped onto a canvas that is a designing area) being shown in the datagrid's columns Name - Quantity - Price. Those values should be obtained from each image but I'm currently unaware of the technique how the information could be added to the images.
    For instance Example1.png has a price value of 150€ and when that image is moved onto a canvas, the name and price should be shown in the datagrid and thus there should be simultaneous changes in the Quantity-column when I move the same image onto a canvas many times. Those images can also be removed from the canvas area and then the quantity should decrease. Obviously that same function should work on other images we have in a menu from where the images are dragged and then moved and dropped in the canvas. If I move Example1.png four times there should be Example1 in the name column, 4 in the quantity column and 600€ in the price column and of course all of them in the same row.
    Pay attention to the code I put into the first post. You may suggest better options how I can sort-of-import (couldn't invent better term) images to the application.
    Later there will be a row in the end of the datagrid/chart where the total price of every object that are moved on the canvas should be shown but that's another story.
    Hopefully this made some sense to the whole thing.

  • About Drag and drop issue

    As title, i am a newbie to flash using ActionScript 2.0 , and currently i enounter the problem with drag and drop coding. Below is my code:
    function dragSetup(clip, targ, position) {
    clip.onPress = function() {
    startDrag(this);
    clip.x +=2;
    clip.swapDepths(clip.x);
    clip.onRelease = clip.onReleaseOutside=function () {
    stopDrag();
    if (eval(this._droptarget) == targ) {
    this.onTarget=true;
    gotoAndStop(position);
    } else {
    this.onTarget=false;
    gotoAndStop(position);
    clip.myHomeX=clip._x;
    clip.myHomeY=clip._y;
    clip.onEnterFrame = function() {
    if(this.onTarget)
              this._x-=(this._x-this.myHomeX)/5;
              this._y-=(this._y-this.myHomeY)/5;
    function dragSetup2(clip, targ, correct) {
    clip.onPress = function() {
    startDrag(this);
    clip.x +=2;
    clip.swapDepths(clip.x);
    clip.onRelease = clip.onReleaseOutside=function () {
    stopDrag();
    if (eval(this._droptarget) == targ) {
    clip._visible = false;
    this.onTarget=false;
    gotoAndStop(correct+1);
    } else {
    this.onTarget=false;
    gotoAndStop(correct);
    var frame:Number = 1;
    dragSetup2(flexibleTxt, questionBox, frame);
    dragSetup(transparentTxt, questionBox, frame);
    dragSetup(blueTxt, questionBox, frame);
    dragSetup(TIRTxt, questionBox, frame);
    dragSetup(TRTxt, questionBox, frame);
    dragSetup(ssmTxt, questionBox, frame);
    dragSetup(siliconTxt, questionBox, frame);
    dragSetup(silicaTxt, questionBox, frame);
    dragSetup(silicateTxt, questionBox, frame);
    dragSetup(infraTxt, questionBox, frame);
    dragSetup(radioTxt, questionBox, frame);
    dragSetup(lightTxt, questionBox, frame);
    dragSetup(copperTxt, questionBox, frame);
    dragSetup(gopTxt, questionBox, frame);
    dragSetup(liquidTxt, questionBox, frame);
    The scenario is , whenever correct mc was drag and drop on the target mc , it move to the next frame with new target mc(new question) , for example "questionBox2".
    By applying the code above, everything work fine but i would like that whenever i "throw" the answer mc (flexibleTxt, blueTxt etc) , i want it to slide or glide for little more distance, jz like how u throw a card in real life on a smooth surface.
    I also prefer that when draging it's "angle?" change according to the direction of draging. For example if u point ur finger on north side of a card and drag to the east, it's "angle?" will change according to the direction u drag, in this case, means east.
    I know my description seem abit complicated but i really someone can undestand and help me solve this issue.
    This is the link i reference to for the code above,but i modify it to my own preference :http://www.swinburne.edu.au/design/tutorials/P-flash/T-How-to-drag-and-drop-in-Flash/ID-37 /
    PS : can i attach my fla file in this forum? if can, why i cant found any attach button?

    I am having a similar but reverse problem: Under 10.5.2, when trying to push or pull files from my wireless MacBook Pro via my Airport Extreme base station to or from my wired G5 Power PC, files hang in mid copy then stall.
    The other way around -- working from the G5 -- I have no problem at all.
    This started with 10.5, but I'm not sure if it was .1 or .2 because I upgraded from 10.4 just recently and did the combined 10.5 updates all at once on both machines.
    Thanks

  • Drag and drop ????

    hi all.
    i have a quick question about drag and drop.
    is it possible to drag a text file on the windows desktop into a jtextarea of an application, and display the file.??
    thanks for your time.
    Paul

    Yes, I would say it is. You need to add the correct listeners to the Panel that contains the text area, and when the right sort of file comes in, you open it, put the data into a StringBuffer and add that to the text pane. Here's a code snippet:
    import java.awt.dnd.*;
    import java.awt.datatransfer.*;
    public class MyPanel extends JPanel implements DropTargetListener
      /** drop action has been changed by drop target */
        public void dropActionChanged(DropTargetDragEvent dtde)
            // must implement
        /** dragdrop entered this panel */
        public void dragEnter(DropTargetDragEvent dtde)
            // must implement
        /** dragdrop exited this panel */
        public void dragExit(DropTargetEvent dte)
            // must implement
        /** dragdrop dragging over this panel */
        public void dragOver(DropTargetDragEvent dtde)
            // must implement
        /** dragdrop dropped on this panel */
        public void drop(DropTargetDropEvent dtde)
            Transferable t=dtde.getTransferable();
            try
                DataFlavor[] dataFlavors=t.getTransferDataFlavors();
                dtde.acceptDrop(DnDConstants.ACTION_COPY);
                System.out.println(dataFlavors.length);
                for(int i=0;i<dataFlavors.length;i++)
                    System.out.println(dataFlavors.getRepresentationClass().toString());
    if(dataFlavors[i].getRepresentationClass().equals(Class.forName("java.util.List")))
    java.util.List list=(java.util.List)t.getTransferData(dataFlavors[i]);
    for(int j=0;j<list.size();j++)
    if(m_frame.doLoad(list.get(i).toString()))
    dtde.dropComplete(true);
    return;
    break;
    dtde.dropComplete(true);
    catch(Exception e)
    Messages.javaException(e);
    The line with 'm_frame.doLoad()' is where I've detected a suitable, file, and go off to open it

  • Drag and drop in iTunes

    Drag and drop is seriously broken in iTunes an has made managing songs an exercise in futility.

    The problem occurs intermittently now that I think about it when I try to rearrange the order of songs that are already on the shuffle. I will highlight an album using the shift key and holding down the left click (The Mouse, MacMice). After a second if it works all songs can be dragged to wherever I want. But the problem is while still keeping the left click of the mouse held down, only one song will be dragged, thus getting the songs out of intended order. Then after using get info to find proper album order, drag and drop messes up again and again so you have a confounded mess. Anyway I didn't want to get into specifics here because I feel that flaming is just around the corner. I just wanted to voice my displeasure about drag and drop not working properly. Thanks, mp

  • Drag and Drop Listbox - Help

    Hello! I am back to doing some LabVIEW programming and ran into a problem that I cannot seem to solve.
    I am trying to use dag and drop on a listbox. I have it set to move only and it works fine. The problem is that if I have a drop event the item moved just goes away. I could not find any examples or answers in the forums.
    Anyone care to teach me about drag and drop?
    Thanks
    =====================
    LabVIEW 2012
    Solved!
    Go to Solution.
    Attachments:
    Drag Drop Listbox.vi ‏8 KB

    Hey rossu,
    I believe that I have found something that may help.  The link below explains how to select multiple items at once.
    http://zone.ni.com/reference/en-XX/help/371361J-01​/lvhowto/setting_the_number_of_sele/
    Also, it may help to repost this issue in a new forum since this one has been inactive for a while.  
    Hope this helped.
    Taylor

  • Drag and drop items still in 1z0-869 ?

    Hello, I wanna ask about drag and drop items still in 1z0-869 Exam
    " Mobile Application Developer" OR not

    Go right ahead!

  • Drag and Drop between Web Dynpro Tables on Cell Basis

    Hi Experts,
    I need to develop a Drag and Drop Functionality as follows:
    I have two tables. I want to drag a row of the first table and drop it in a particular cell of the second table.
    Is it possible to implement this using the Web Dynpro Drap and Drop Functionality?
    If not, does anybody have an idea of how to implement this using other concepts (Flash Integration, Building up a Grid of Images and defining those as drop tragets, etc..)??
    Valuable Advice is highly appreciated!
    THANKS, Johannes

    Thanks for the Video.. It gives some information about Drag and Drop, but still, it does not say what I need to know.
    Again:
    I need to know if there is a way to drag particular cells in a Web Dynpro Table to other locations in that same table. Plus: I need to know if there is a way to drag and drop rows of one table into particular cell of another table.
    Similar to what we do in our Outlook Calendars: We have a week in view and we see our appointments as blocks within that week view. Now, we can drag and drop these blocks to other locations. That is what I need to implement!
    Does anybody have an idea?
    THANKS, Johannes

  • Drag and drop components

    hi folks,
    am using jdev 11.1.1.5.0 - adfbc.
    when am i wondering about drag and drop components in ADF 11g.
    i get some of the example.
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/60-table-drag-n-drop-sample-176981.pdf
    http://www.baigzeeshan.com/2011/01/drag-and-drop-collection-in-oracle-adf.html
    http://www.baigzeeshan.com/2010/07/implementing-drag-and-drop-functionaly.html
    http://www.gebs.ro/blog/oracle/adf-drag-and-drop-hints/
    http://www.gebs.ro/blog/oracle/oracle-adf-overcome-adf-restrictions-on-copying-components-with-drag-n-drop/
    ok fine. is there any other links. make more interactive in UI
    need is :
    make my user to feel free use my application.

    What about the product documentation ?
    http://docs.oracle.com/cd/E23943_01/web.1111/b31973/af_dnd.htm#CIHCHGIF
    Also, the following book:
    has a chapter (chapter 14) on drag and drop
    http://www.amazon.com/Oracle-Fusion-Developer-Guide-Applications/dp/0071622543/ref=sr_1_cc_1?s=aps&ie=UTF8&qid=1343975521&sr=1-1-catcorr&keywords=Oracle+Fusion+Developer+Guide
    Frank

  • Drag and drop data from Numeric Control or Numeric Array to excel file

    I have two inquirries about drag and drop:
    1. How to drag and drop data from a Numeric Array or Numeric control to excel file
    2. How to drag and drop data from a Numeric Array or Numeric control to an Numeric array Indicator?
    The item 2, I tried it with the event structure, but it didnt work.
    Please do reply.
    mytestautomation.com
    ...unleashed the power, explore and share ideas on power supply testing
    nissanskyline.org
    ...your alternative nissan skyline information site

    There are very good drag and drop examples that ship with LabVIEW.  Have you looked these over to see if they can be modified for your needs?
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

  • Drag-and-drop tree list from files/folder

    Hello all. I'm new to Flex and I'm looking for some help or
    for someone to point me in the right direction. I want to write a
    simple AIR application to accept a multiple text files (or a folder
    full of text files) when the files/folder is dragged into a tree
    list. The file/folder name will be the node name. When selected,
    the contents of the file will be displayed in a text area. The text
    file will contain a 4 x 4 number matrix with each column separated
    by a tab and each row separated by a return. (I plan on plotting
    the numbers in the matrix in the future).
    What I'm most confused about is how to go about
    dragging-and-dropping files into a tree list and creating item
    names based on the file/folder name? And does the file content need
    to go into an array collection?
    Maybe I'm going about this in a difficult way. If there is an
    easier way, I'd appreciate it if someone could share. Thank you
    all.

    I have the same problema and I´m not able to find the reason.
    The solution to get the event raised has been to copy configurations from wd standard appl FPM_TEST_DND_FORM and use my own Z feeder class : all  seems to work perfectly , but , if I try to do it from scratch the event  FPM_DROP_COMPLETED it´s not raised .
    I´ve compared both configurations/class ( the one that I´ve done from scratch  that it doesn´t raise the event and the one that I´ve adapted copying from standard that it raises perfectly  the event) and I haven´t  seen any difference (maybe I haven´t found) .

  • Drag and drop parts of an image

    Is there a way to display an image (such as a scanned page) and then have areas that can be dragged and dropped? For instance, suppose the scanned page has some text fields. I would like some of text fields in the scanned form to have boxes around them (perhaps a different color, perhaps marching ants) to indicate that they are fields of interest. I would like to be able to drag and drop one of those text fields onto another text field (probably on the right side of a split pane - this right panel is not a scanned image but a panel with real fields). I've seen information about dragging and dropping fields and images but not precisely this problem. Thanks for any help. I'm new to Swing and so am out of my league.

    You want the user to select the area? Sure that can be done fairly simply. You want the app to automatically figure out what parts of an image are what? That's not simple at all.
    Either way, it's not so much about swing as custom painting. Try checking this out:
    http://www.jhotdraw.org/

  • Why can't I drag and drop songs within my playlist?

    Why can't I drag and drop songs within my playlist?

    Are you automatically updating your iPod?
    Are you talking about dragging and dropping in iTunes?
    ~iBook G4 1.07GHz (Kaiya), with extra 256MB RAM (Mac OS X 10.3.9)~ LaCie 160GB external hard drive~ ~3G 15GB iPod (Nakai)~ ~GiveStarsto users who earn them.~

  • 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

  • Drag and Drop Funcionality

    I would like to build a web page that supports drag-and-drop functionality ... e.g. drag an image from one area of the page to another. I have read that JSF supports drag-and-drop and was looking for ways to implement this functionality using Java Studio Creator. So far I have not found anything in the tutorials, and when I search in these forums for "drag and drop" I get lots of descriptions of dragging-and-dropping components onto a page (i.e. building a page) but not implementing drag-and-drop functionality itself. Any tips on where to find this information is appreaciated.

    Thanks for the link about dragging and dropping Swing objects.
    Now I am stuck, because it seems the only kind of ojbects that can be dragged-and-dropped are java.awt.Component obects. All the cool objects from the Creator Palette are not java.awt.Component objects so it appears I cannot implement drag-and-drop for those?
    The below works okay, because btn is a java.awt.Component object.
    Button btn = new java.awt.Button();
    dragSource.createDefaultDragGestureRecognizer( btn,
    DnDConstants.ACTION_MOVE, this);
    But if instead of btn I try to use one of the objects from the Creator Palette (such as a Button which is of type com.sun.web.ui.component.Button) I get an error.
    So then is there no way to implement drag-and-drop functionality with these cool new Creator GUI objects? Thanks.

Maybe you are looking for

  • Applying multiple effects to a Node?

    How can I add more than one effect to a Node at the same time?  I want to add a blur and drop shadow to a Shape concurrently.  Can it be done?

  • Vault size

    I have a large, referenced aperture library.  When I do "update all vaults" the file size is very small.  Is there any way for me to make sure that all of my projects are being backed up in the vault

  • 'iTunes Producer cannot be installed on this computer'.

    I'm trying to download iTunes Producer to upload an iBook. I have a free books account. I downloaded the dmg file to my computer, but when I click on it, I get a message 'iTunes Producer cannot be installed on this computer'. Any ideas why? I have un

  • Uninstall adobe photoshop 12

    I have Adobe Photo shop 9 which I like. I up graded to Adobe Photoshop 12 and I hate it. Takes forever to load and what I used to know on 9 isn't the same on 12. I want to uninstall 12 but I keep getting an error message1306. How do I get rid of 12

  • Where is Terminal on admin account?

    I need to correct custom permissions. I understand that to do that, I must enter certain commands into Terminal. But when I enter admin account, I do not see "Terminal."