How to implement drag&move JLable?

hi,
I am new to swing and pardon me if I ask some real simple questions.
Using swing, i want to be able to drag&move components (like JLable/JTextField)
in my content pane and then get components' precise postions (in X, Y coordinates, or
something like that). It is like moving puzzle pieces around.
PLS note: I want to MOVE the WHOLE component, NOT only the text within the component.
Does swing support this internally? How can I do that? Any comments/suggestions/sample code
are truly welcome.
Thanks a lot.
JK

Do the way like DnD text for Label, except you put the entire JLabel component as Transferable data object.
- The DropTarget will get the component and add it to "parent" ( "parent" is the container component that you like add the draged JLabel component)
- The DragSource will get the endDrop notification and call its "parent" to delete the JLabel component dragged.
You must deal with the "parent" container to add/delete the component for this special DnD component.
There are no default Swing DnD support for it.

Similar Messages

  • How to implement Drag and Drop in trees

    Hi,
    I have two hierarchical tree in a form, i need to drag each nodes form one tree node and drop into another tree, how i possible. am using Forms 6i developer.

    Drag-n-Drop is only available in Forms by extending Forms with a Java Bean. In order to use a Java Bean in your form, your form MUST be web deployed; if you are using traditional Client/Server with your Forms 6i then there is no way to implement Drag-n-Drop.
    Take a look at: Drag 'n Drop - Oracle Forms PJC and Java Beans. This article was based on using Oracle Forms 9i so you might not be able to implement it in your Forms 6i app.
    Craig...

  • How to implement drag-and-drop functionality in xMII iGrid?

    Hi,
    Is it possible to implement the drag and drop functionality between two iGrids of xMII in an irpt page? If yes can anyone please explain how?
    Thanks in advance,
    Dipankar

    http://tool-man.org/examples/sorting.html
    You would have to be creative and do something like this.

  • How to implement drag/drop ?

    Hello,
    I want to build a GUI showing the view of a weekly calendar.
    (Days on the Y Axis and events for that day on the X axis)
    I want to draw each event as a rectangle. Also, I want to be able to drag the rectangles, and draw
    them using rubberbanding (i.e hold the left mouse button down and drag to create a new event)
    Is it a good idea to use Java 2D to create the above kind of functionality ?
    Or should I be trying AWT or Swing instead ?
    I think it will be easier to get the click and mouse move events if I draw each event as an AWT component.
    But I am not sure how I am going to be able to handle drawing the events at the exact co-ordinates if
    I use AWT.
    Basically, I am stuck on whether to choose Java 2D or to choose AWT/Swing ?
    Please guide me through your experience.
    Ajay

    Hello,
    I want to build a GUI showing the view of a weekly calendar.
    (Days on the Y Axis and events for that day on the X axis)
    I want to draw each event as a rectangle. Also, I want to be able to drag the rectangles, and draw
    them using rubberbanding (i.e hold the left mouse button down and drag to create a new event)
    Is it a good idea to use Java 2D to create the above kind of functionality ?
    Or should I be trying AWT or Swing instead ?
    I think it will be easier to get the click and mouse move events if I draw each event as an AWT component.
    But I am not sure how I am going to be able to handle drawing the events at the exact co-ordinates if
    I use AWT.
    Basically, I am stuck on whether to choose Java 2D or to choose AWT/Swing ?
    Please guide me through your experience.
    Ajay

  • DPS - Web Content Overlay. How to implement dragging action in .folio?

    Hi there
    I am building a huge project, some kind of encyclopaedia with multimedia and interactive content I created using both Tumult Hype and Adobe Edge Animate 1.0. They are perfectly well loaded onto their own respective Web Content Overlay and work almost perfectly.
    One of them is a draggable game in which you drag a man towards one side or another just to see how it inclines. I have tried it in many browsers and it simply works perfectly well. But, when I bring it into the inDesign document (into a MSO) I can't drag the man, as the ACV changes the page.
    What can I do? Is there any way of avoiding this default behaviour when using these interactive content?
    Best regards,
    Luis Santa-Maria

    Ok, thanks for not answering anyway.
    I have managed to get the solution by myself. I just put a e.preventDefault(); function when dragging, and it just worked.
    Thanks again to all those who didn't help and knew how to do it.
    Best regards

  • How to implement drag and drop functionality in a HTML5 webpage using touch events?

    Hi all,
         I need to create a webpage having two parts.One part is having set of SVG images into it and other part is having canvas.I need to drag those image onto the canvas allowing same image for multiple times and those images on the canvas are movable inside the canvas only. This webpage is only used in iphone or ipad like touching devices so I need to handle touch events.
         There is already jQuery plugin for drag drop functionality but it is not supported for touch events.
    It is only for desktop veriosns.So if you know about any jquery plugin let me know.
         So please help me to carry out this task.

    I have tried using the same but still not working.
    I have handled touch events like touchstart,touchend,touchmove.
    But the problem is when I drag the image from upperbox onto canvas, the clone of that image is creating but the image which I dragged on canvas gets vanished.
    I am creating clone because I want to add multiple images onto canvas.
    Atik

  • How do you drag clips into imovie on mac laptop, how do you drag clips into imovie on mac laptop

    how do you drag movie clips from a sim card into imovie on a mac laptop?

    Open iMovie. Go to File>Import Videos and then find the files you want to import.

  • HT3819 how do I share movies/music between my computers. I have opened shared on both computers and both are on, but i am not able to drag anything from one to the other. Does anyone know where the settings button is on the bottom of the itunes screen?

    how do I share movies/music between my computers. I have opened shared on both computers and both are on, but i am not able to drag anything from one to the other. Does anyone know where the settings button is on the bottom of the itunes screen?

    Oops, I forgot a step between 7 and 8 ... before syncing the iPhone I need to explicitly send the document back to iTunes on the iPhone, or the changes won't come over at all ...
    and then one more thing ... Numbers on iOS does NOT recognize a number of key features of the OSX app, such as conditional formatting ... so after editing my document on iOS and syncing it back to OSX on my Mac, all of those settings are lost (no more conditional formatting, have to do it all over again)
    What am I doing wrong ?

  • I am organizing my external HD and want to move files NOT COPY them. How do I drag and drop folder contents without Mac automatically copying them to the "drop" location?

    I am sorting out all the clutter and duplicate files on my external HD. In doing this I am moving the entire contents of folders to new locations. Some of these folders cointain gigs of info. I do not want to have to spend large amounts of time waiting for hundreds of gigs to copy somewhere then  moving the originals to the trash and wait even longer deleting all of them. All I want to do is move the files up a subfolder, but the way Finder goes aobut doing it can be a 400 GB swing taking hours. How do I just "move" them?

    Check out this discussion. Worked for me.
    http://tinyurl.com/7dmh9p5
    Quote:
    When I do a drag and drop in Finder to move a folder into another folder it makes a copy of the folder in the new location instead of moving it like the help documentation says and like it used to do in Snow Leopard.  I have looked all over in preferences for a setting the contols the move/copy outcome of drag and drop and have been unable to find anything.  Is this the way Lion is supposed to work?
    MacBook Pro, Mac OS X (10.7.1)
    This solved my question by jsd2  on Oct 9, 2011 6:33 AM
    I did a global change of permissions for the entire documents account in the currrent user account using the get info and apply to enclosed items.
    I think what is happening is that the Documents folder normally carries an "everyone deny delete" ACL, meant to protect it from accidental deletion:
    $ ls -lde ~/Documents
    drwx------+ 6 t1  staff  204 Oct  9 08:51 /Users/t1/Documents
    0: group:everyone deny delete
    ACLs are special types of permissions that do not show up in GetInfo, but can get propagated if you click "Apply to Enclosed Items" on a folder that carries them. Affected files that acquire  that ACL would require password authentication to move or delete them.
    I think the following Terminal command (copy and paste it) should remove such ACLs from items within the Documents  folder:
    chmod -RN ~/Documents/*
    Message was edited by: miz_mdk

  • JTable - how to disable the drag / move  for column

    hi there, please give me a hand with this problem,
    i am trying to disable drag / move column in JTable.
    ie.
    ===============================================================
    JTable mainTable = new JTable();
    tableModel recordTable; //this extand AbstractTableModel
    this.mainTable.setModel(this.recordTable);
    ie.
    Product size quantity price
    Shoe 8 200 $120
    Shirt 9 100 $100
    Dress 12 50 $60
    the position of column Product,size,quantity,price, however, if i click on price and drag, i will be able to move the whole lot and place to different position ie. Product,price,size,quantity.
    =======================================================================
    please let me know how can i stop this happening....

    Try something like this:
    mainTable.getTableHeader().setReorderingAllowed(false);

  • New user...how do you drag or move or copy a file or folder from the desktop to an external drive?  I have tried dragging and copy/pasting.

    new user...how do you drag or move or copy a file or folder from the desktop to an external drive?  I have tried dragging and copy/pasting.

    My guess the problem you are running into is the drive is formatted for a PC as NTFS. OS X can read files from NTFS however it cannot write to it. Check the formatting on the drive, if it's NTFS then it should be reformatted to Mac OS Extended (Journaled), you can use Disk Utility to do this.
    If you still have a PC and want to share the EHD with the PC and Mac please read MacWorld's Share an external drive between a Mac and a PC article.

  • How do I drag-and-drop my Web Bookmarks Folder to a external flash drive? I need to move them from one Mac to another Mac.

    '''Moving Firefox URL Bookmarks from one Mac to another'''
    How do I drag-and-drop my web 'Bookmarks Toolbar' folder from one Mac to an external USB zip drive. Unable to network both Macs and use the migration feature. Must do this manually. Thanks!

    Hi RMcMullen,
    You should look at the [[Backing up your information]] Knowledge Base article. It will give you all the information you need to back up everything so you won't lose a thing.
    Hopefully this helps!

  • How do I drag simultaneously mulitple images viewed in Preview to Finder. I know how to do one image at a time by dragging

    How do I drag multiple images simultaneously from Preview to Finder. I know how to do one at a time. However since I typically shoot at 12 frames per second, sports photography, I have a lot of images to move of one athlete while in motion.

    (A personal footnote):
    Why are you using Preview at all? I hardly ever use it for anything, finding it very limited.
    I am only an amateur photographer, but I much prefer GraphicConverter which, for example, in batch mode would do much of what you ask.
    IMO it is probably the best shareware application ever written for the Mac.
    If you don't know it, give it a try:
    http://www.lemkesoft.com/content/188/graphicconverter.html

  • How do i drag media to the menu screens in premiere elements 13? I can't see my audio files and the menu screens at the same time. In prior versions it was easy

    How do i drag media to the menu screens in premiere elements 13? I can't see my audio files and the menu screens at the same time. In prior versions it was easy?
    It is very cumbersome to "re browse" for audio files/pics/movie clips to add to menu screens. Certainly there is a way to view the media and menu screen at the same time so I can drag and drop?

    Jayhawk
    I think I know exactly what you are seeking and believe it cannot be done in Premiere Elements 11, 12, and 13 as it can be done in versions earlier than 11 where the Disc Layout and Project Media are viewed side by side.
    Premiere Elements 13 uses a Movie Menu customization workspace which is not allowing viewing of Project Assets in the Expert workspace at the same time.
    ATR

  • How can i transfer movies from my osx 10.7.5 macbook pro to a wireless hd in my network?

    How can I transfer movies from the movie folder on my macbook pro to a wirless HD in my home network. I cannot drag/drop, or copy/paste as the paste command is greyed out when I attempt to paste....13" macbookpro, OSX Lion 10.7.5
    any help would be appreciated !!

    Drag the file from your Movies folder to the wireless hard drive icon on your desktop.

Maybe you are looking for

  • Error while deploying war in weblogic 10.3.0

    I am deploying a war file on to WLS 10.3.0 . I get the following error <Jul 18, 2012 1:32:08 PM CEST> <Error> <Console> <BEA-240003> <Console encountered the following error weblogic.application.ModuleException: Failed to load webapp: 'MNPBULK.war' a

  • At&t owes me money and can't get it

    I cancelled my phone service with this company 2 2 years ago and I paid more than what the final bill was and I have spent numerous hours on the phone trying to get my money back and can't. I mailed the company several times and can't get my money ba

  • Acrobat 9.0 Pro and Office 2008 updates download but won't install

    I hope I'm not alone experiencing the following difficulties installing third party patches and updates and that someone who reads this may recognize the problem…and its solution. I've run Adobe Updater (6?) for CS4 Design Standard which includes Acr

  • Export PCUI search result to Excel over Context Menu / right mousebutton

    Hello I am using CRM 5.0 and PCUI I want to export the search result into Excel, on Servicetickets (BUS2000116). When i press the right mousebutton on the searchresult, I get the option Export to Microsoft Excel. When i choose this option, Excel open

  • How to store date/time information in a channel?

    Hello, I'm logging manufacturing test data into TDM files from LabWindows CVI 8.0. So far, I've organzied the data like: one Channelgroup for each Measurement type one Channel per DUT into eah Channelgroup There is a new tdm file creatd each day. For