I want to make a VBIDE-Like drag and drop programm using Swing

I am using swing am able to display no.of JInternalFrames on JDesktopPane to achieve an senario as in the VB-IDE we can easy resize and move the VB-components like Label ,Button ...But i want to drag a JButton or JLabel from any JToolBar and when i draw a rectangle,with dotted lines , on some container (may be JDeskTopane) and when i realese the Mouse then that JButton or JLabel will be displayed on the container.Please give me any idea,code,links or hints so that i can complete it.i.e How i can develope a VB-Ide like drag and ide in Java..
Thanks in advance....

Hey there buddy!
You may like to check out the code for some projects on sourceforge if you wish to build something like this. Firstly, it is no easy task you are undertaking, but a good one none the less!
The projects I have in mind are the following ones:
Abacus GUI builder:
http://sourceforge.net/projects/abaguibuilder
JUIE
http://sourceforge.net/projects/juie
Have a look at the code to see how it is done. JUIE uses AWT but is in the process of being upgraded to swing. Abacus is currently Swing based.
As far as I know, you are going to have to learn about Mouse handlers, in particular public void mousePressed();mouseDragged() etc... You will also need to learn about the layered pane architechture of Swing. When you click on your button it would (presumably) create a new button, add it to one of the thousands of possible layers you can have, and when you drag that component, the mouseDragged event will constantly send updates to the component to re-position it in the GUI...
Good luck with it and I would be very interested to see how you went about it in the end.
Take care
Jason Barraclough.

Similar Messages

  • Small game like drag and drop

    i'm new to flash action scrip but i want to create small game like drag and drop. but this has special area to drop and after drop selected object ,then i want to change that object(replace object by another object) using mouse move(scrolling). here what i did up to now
    bold area is the specialy i want to know, please help....
    ball_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    ball_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    square_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    square_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void
        event.target.startDrag(false);
        event.target.parent.addChild(event.target);
    function dropIt(event:MouseEvent):void
        event.target.stopDrag();
    ball_mc.buttonMode = true;
    square_mc.buttonMode = true;

    I don't know which line you intended be bold, but the following line makes little sense...
    event.target.parent.addChild(event.target);
    If the parent of the event target is the parent, then the event target is already the child of the parent.

  • Pages: I want to reorganize items in folders, drag and drop is not working. So how can I do this?

    Pages: I want to reorganize items in folders, drag and drop is not working. So how can I do this?

    This is the very top of the documents view in the Pages app. If you don't see this, swipe down in this window to reveal the Date and Name tabs like you see here. If you tap on - Name - that arranges all of the documents in alphabetical order in this view and it also arranges documents in the respective folders alphabetically. If you tap on - Date - that will arrange all documents by the date that they were created or last edited. You want to make sure that you keep Name as the default at the top.
    Trust me, this does work. If you name the chapters alphabetically .... Chapter 1, Chapter 2, Chapter 3, or if you simply name them A, B, C, D, etc. they will be arranged in that order using the Name button at the top, which uses alphabetical order to arrange the documents.

  • Is it possible to create a tree with drag-and-drop functionality using ajax

    I saw these samples;
    Scott Spendolini's AJAX Select List Demo
    http://htmldb.oracle.com/pls/otn/f?p=33867:1:10730556242433798443
    Building an Ajax Memory Tree by Scott Spendolini
    http://www.oracle.com/technology/pub/articles/spendolini-tree.html
    Carl Backstrom ApEx-AJAX & DHTML examples;
    http://htmldb.oracle.com/pls/otn/f?p=11933:5:8901671725714285254
    Do you think is it possible to create a tree with drag-and-drop functionality using ajax and apex like this sample; http://www.scbr.com/docs/products/dhtmlxTree/
    Thank you,
    Kind regards.
    Tonguç

    Hello,
    Sure you can build it, I just don't think anyone has, you could also use their solution as well in an APEX page it's just a matter of integration.
    Carl

  • Drag and drop images using tilelist in flex

    i just want the working code for drag and drop images using
    tilelist in flex

    Try JDK 1.4 and call setDragEnabled(true)
    I will also post updated version of MediaChest soon using custom TransferHandler for DnD different types of Objects.

  • Setting drag and drop components using script

    Hi,
    Is there a way to set the drag object name and target name of
    the Drag and Drop component using actionscript? I have looked
    through the help files and there is no mention of how to do this. I
    cannot find any methods relating to the Learning Interactions
    either. Can this be done or am I trying to do something that Flash
    is not capable of?
    The reason I wish to do this is so I can retrofit the D&D
    component into existing code. The existing code generates new
    object/target pairs and stores them in an array. I need to be able
    to read these values and plug them into the component at runtime.
    Any ideas?
    TIA
    Colin

    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

  • Is it possible to make a graph with drag and drop plots and use it as a control?

    I am trying to make a graph with multippel plots to use as a control, the plots should be drag and drop. Is this possible in LV 7.0 or do i have to use c++ or WB?

    I second Doc-Doc comment. I am not sure what you are asking.
    The attached is an example I found on the NI web-site some time ago. I cannot find the link again so here is a ZIP of what I found in a temp folder on my machine.
    Trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    WF_SketchPad.ZIP ‏67 KB

  • Photo problems and can i drag and drop files using windows explorer?

    i can only sync photos frm my com to my touch but i cant choose which photos i want and i tried searching for the files in itunes and i cant find them, thus cant delete them...
    on top of that, i can access the files in my touch but cant find any option to delete them...
    when i go the photos tab in itunes, it only shows me the window to sync files and the 2nd question too...
    because when i drag and drop on itunes, it's quite laggy...and if i use windows explorer to drag and drop, will the duplicates on my playlist appear as 2 files or will it be like itunes where it can detect the main file and simply adds it to the list?
    thank you...
    sorry for the wall of text...

    There's no manual mode for photos just different ways to sync but here's a simple "How To" on managing your photos so that it's easy to add and delete what you want on the iPod:
    1 Create a folder on your hard drive to hold the photos you want on your iPod. Call it iPod Photos for example
    2 Drag the photos you want from your usual picture folder into the folder you just created
    2 Open iTunes, select your iPod in the iTunes Source list.
    3 Click the Photos tab and select “Synch photos from.”
    4 Choose “Choose Folder” from the pop-up menu and select the iPod photos folder you created.
    5 When you want to change what photos are on the iPod just add or remove the photos from the folder you have made and syncronise the the iPod
    You can't drag photos or music to the iPod from Windows Explorer, you have to add content through iTunes or you'll not be able to view or play it.

  • Drag and drop questions using image and painting

    Hi all,
    please apologize me if i'm posting a just discussed topic, but I couldn't find anything that could help me.
    I'm trying to create an application where I've a Jtree on the left panel that contain entities that have to be dragged and dropped in the central panel (eventually pasting a representative image) as user decide.
    I've just implemented all panels and jtree. I read java tutorial on drag and drop, but I don't know HOW i can paste image as objects that then i can manipulate in such a way that the user needs.
    Do I have to use java.awt.dnd package?
    Please, I'd like to receive some suggestion about.
    Thanks in advance for your kindness.
    Vincenzo

    I'm sorry, I think that i've not been clear in my explanation. I don't know how to transfer by drag & drop an image (a node of a jtree) to a beside panel. I don't want to get code, it will be more appreciate suggestions on how to proceede.
    I don't understand if I need java.awt.dnd package. On java tutorial I read that it shouldn't have to be used.
    Thanks, I hope that I've been clearer now.

  • Designing a Drag-and-Drop Template using InDesign

    Hi,
    Please forgive my naivity here - I have just been handed a project for which I am completely unqualified, and am hoping for your help!
    I need to design an advertising booklet (folded A4 - i.e. each page being A5) to go out each month. Our customers will submit their adverts to us in various formats (single slot, double slot, half page, full page, etc, etc).
    My aim is to create a template for this so that, each month, I just need to drag and drop the adverts as they arrive, into set fields on the page, so that I don't have to worry about page layout, bleeding, etc.
    My boss has handed me a copy of InDesign CS5, and instructed me to see what I can do...
    So, firstly: is it possible to do what I'm trying to do?
    If not, what would your collective minds suggest is the best idea?
    If so, how do I do it? Are there tutorials online that I can follow through? If not, can someone instruct me on how to get started?
    Your assistance is appreciated!
    AJ

    First place to start with InDesign is this book: http://amzn.to/biUyIZ
    You can also check out Lynda.com. For $25/month you can't beat it.
    That said, yes, what you want to do can be done by creating a template, but you'll need to give your clients very specific instructions on how to create the PDFs that you'll want to drop into your book.
    One last suggestion, have a talk your boss about expectations. Buying InDesign doesn't make you a designer and more than going to Home Depot and buying tools will make you a carpenter. Learning ID will take some time.
    FWIW, I do offer remote training sessions, if you boss is so inclined to pay for it. You can find my contact info on my website, www.theindesignguy.com
    HTH,
    Bob

  • Simple drag and drop programme. Bug

    Hi.
    I have a simple drag and drop app for learning English. You hear for eg: banana and have to drag that object to a certain area.
    When my little kid plays it she finds bugs - she's my researcher.
    It's hard to explain the bug as its hard to get it but kids can easily. You click on the target object and drag it a little, then quickly reclick it but not drag ie: release the mouse as it goes back to its initial position. You move the mouse away and and the object follows mouse even though you are now not dragging and you can't drop it.
    I know its hard to imagine this but perhaps this is a know bug for drag and drops.
    private function dragHandler(e:MouseEvent)
                e.currentTarget.startDrag();
                xIni = e.currentTarget.x;
                yIni = e.currentTarget.y;
    The you have the following which has an event listener for the mouse up event.
    private function checkDrag(e:MouseEvent)
                e.currentTarget.stopDrag();
                if (this.currentBubble.hitTestObject(this.dragTarget))
                    if (currentBubble && currentBubble == e.currentTarget)
                        currentBubble.visible = false;
                        blnCorrect = true;
                        points = this.points + 10;
                        score.score_txt.text = String(points);
                        correct++;
                        vehiclePosition+=100;
                        TweenLite.to(animation,1,{x:vehiclePosition})
                        trace("CORRECT="+correct);
                        if (correct == 10)
                            endGame();
                            return;
                    bubbles.splice(currentIndexArray,1);//you must specify the parameter 1 ie: remove 1
                    sndChannel=soundCorrect.play();
                    sndChannel.addEventListener(Event.SOUND_COMPLETE, soundCorrectComplete)
                else
                    incorrect++;
                    sndChannel=soundIncorrect.play();
                    sndChannel.addEventListener(Event.SOUND_COMPLETE, soundIncorrectComplete);
                    TweenLite.to(e.currentTarget, 1, {x:xIni, y:yIni, ease:Strong.easeOut, onComplete:onFinishTween});

    So, the code should be like this:
    private function dragHandler(e:MouseEvent):void
         e.currentTarget.startDrag();
         stage.addEventListener(MouseEvent.MOUSE_UP, checkDrag);
         xIni = e.currentTarget.x;
         yIni = e.currentTarget.y;
    private function checkDrag(e:MouseEvent):void
         stopDrag();
         stage.removeEventListener(MouseEvent.MOUSE_UP, checkDrag);
    Also, i suggest you get into habit to ALWAYS declare datatypes, including what functions return - it is good for memory and performance. In your case, :void should be function return datatype.
    In addition, you don't need to stopDrag() on an object - since only a single object can be dragged at a time - just calling stopDrag() is sufficient.

  • Drag and drop problem using  NW04 SPS 19

    Hi,
    we have a problem using drag and drop between two input fields. If i use this functionality i get after some minutes a message "A script on this page is causing IE to run slowly. If it continues to run, your computer may become unresponsive. Do you wan't to abort the script?"
    Any idea to solve the problem?
    If i try the same functionality on NW04s - it works fine.
    Thanks in advance
    Stefan

    closed

  • How do I create a drag and drop interaction using Captivate 8?

    I cannot figure out how to create a drag and drop interaction in Captivate 8. Options to do this are greyed-out.

    You can only use D&D in normal projects, not in responsive projects.
    http://helpx.adobe.com/captivate/kb/top-issues-captivate-8.html

  • Ipad was erased. Now apps won't reload from backup, but show in the app window. They do't sync even when drag and drop is used.

    The iPad was lost but returned. In the interim, I sent an "erase" command to the iPad. When I got it back , all info was erased when turned on. I used my backup and restored it, but the applications will not install. I have tried clicking "install". I subsequently tried the drag and drop method. Each time I "apply" the changes, It will sync, but nothing happens as far as applications being installed.
    thanks.

    Having the same issue.  I got the iPad air and loaded apps from my phone but netflix didn't show up and won't open from the App Store

  • Drag and drop problem using .as

    Hi , with the code below, I can pick up object but, as soon as I mouse-up, the object snaps back to its original x and y position.
    Can someone please tell me what I am doing wrong AND how I can randomize objects.
    package
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.display.DisplayObject;
    import Card;
    import Targetdog;
    import Targetcat;
    import Targetbird;
    import Dog;
    import Cat;
    import Bird;
    public class DragDrop extends MovieClip
      private var  _card:Card;
      private var _card2:Card
      private var currentTargetdog:Targetdog;
      private var currentTargetcat:Targetcat;
      private var currentTargetbird:Targetbird;
      private var bird:Bird;
      private var cat:Cat;
      private var dog:Dog;
      private var _cardX:Number;
      private var _cardY:Number;
      private var _card2X:Number;
      private var _card2Y:Number;
      var startX:Number;
            var startY:Number;
            var counter:Number = 0;
      public function DragDrop()
       createCards();
       createCards2();
      private function createCards():void
       _cardX = 100;
       _cardY = 25;
       for (var i:Number = 0; i<1; i++)
       _card = new Card();
       addChild(_card);
       currentTargetdog = new Targetdog();
       _card.setType(currentTargetdog);
       _card.x = _cardX;
       _card.y = _cardY;
       _cardY +=  _card.height + 1 ;
      for (var j:Number = 0; j<1; j++)
       _card = new Card();
       addChild(_card);
       currentTargetcat = new Targetcat();
       _card.setType(currentTargetcat);
       _card.x = _cardX;
       _card.y = _cardY;
       _cardY +=  _card.height + 1 ;
      for (var k:Number = 0; k<1; k++)
       _card = new Card();
       addChild(_card);
       currentTargetbird = new Targetbird();
       _card.setType(currentTargetbird);
       _card.x = _cardX;
       _card.y = _cardY;
       _cardY +=  _card.height +1;
      private function createCards2():void
       _card2X = 450;
       _card2Y = 25;
       for (var a:Number = 0; a<1; a++)
       _card2 = new Card();
       addChild(_card2);
       dog = new Dog();
       _card2.setType(dog);
       _card2.x = _card2X;
       _card2.y = _card2Y;
       _card2Y +=  _card2.height + 1 ;
      for (var b:Number = 0; b<1; b++)
       _card2 = new Card();
       addChild(_card2);
       cat = new Cat();
       _card2.setType(cat);
       _card2.x = _card2X;
       _card2.y = _card2Y;
       _card2Y +=  _card2.height + 1 ;
      for (var c:Number = 0; c<1; c++)
       _card2 = new Card();
       addChild(_card2);
       bird = new Bird();
       _card2.setType(bird);
       _card2.x = _card2X;
       _card2.y = _card2Y;
       _card2Y +=  _card2.height +1;
            dog.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            dog.addEventListener(MouseEvent.MOUSE_UP, dropIt);
            bird.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            bird.addEventListener(MouseEvent.MOUSE_UP, dropIt);
      cat.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            cat.addEventListener(MouseEvent.MOUSE_UP, dropIt);
      function pickUp(event:MouseEvent):void {
       event.currentTarget.startDrag();
        event.currentTarget.parent.addChild(event.currentTarget);
        startX = event.currentTarget.x;
        startY = event.currentTarget.y;
    function dropIt(event:MouseEvent):void {
        //reply_txt.text = "Daaa";
        event.currentTarget.stopDrag();
        var mycurrentTargetName:String = "currentTarget" + event.currentTarget.name;
        var mycurrentTarget:DisplayObject = getChildByName(mycurrentTargetName);
    if (event.currentTarget.dropcurrentTarget != null && event.currentTarget.dropcurrentTarget.parent == mycurrentTarget){
        //reply_txt.text = "Trés bien!";
        event.currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
        event.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
        event.currentTarget.buttonMode = false;
        event.currentTarget.x = mycurrentTarget.x;
        event.currentTarget.y = mycurrentTarget.y;
        counter++;
    } else {
        //reply_txt.text = "Essaie encore!";
        event.currentTarget.x = startX;
        event.currentTarget.y = startY
    //if(counter == 3)
    dog.buttonMode = true;
    cat.buttonMode = true;
    bird.buttonMode = true;

    Hi Ned,
    sorry about the code centering.   That happened during copying and pasting.
    The line in question is the trace statement you suggested.
    I am still finding that moving the brace in question also makes a difference to the output information I receive.

Maybe you are looking for