Drag And Drop Components IN Flex

hello all,
could we do code for drag components or controls like
boxes,slider,data grid,and related things from 1 canvas to another
canvas ?
I want to show all controls in left canvas and allow user to
drag it and drop in right canvas .
Thanks,
Bachi

"BachiSree" <[email protected]> wrote in
message
news:gc4j1a$m57$[email protected]..
> hello all,
> could we do code for drag components or controls like
boxes,slider,data
> grid,and related things from 1 canvas to another canvas
> I want to show all controls in left canvas and allow
user to drag it and
> drop
> in right canvas .
http://www.quilix.com/node/3

Similar Messages

  • 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

  • Dragging (and dropping) components in a panel

    I want to learn how to move a component or image around in a panel and drop it. To also drop other images and then connect the images with a connecting line. I don't really need to go into the Drag and Drop API because I'm just staying in my GUI. Can someone direct me to a resource that might help me?
    Gracias,
    Miguel

    Hi!
    Here's a small program with a draggable Button.
    Have a look at the class 'DraggableButton'.
    Cheers Tom
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DragButton extends JFrame {
         public DragButton()     {
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              getContentPane().setLayout(null);
              DraggableButton b = new DraggableButton("Drag me");
              getContentPane().add(b);
              b.setBounds(30,30,100,30);
         public static void main(String args[]) {
              DragButton f = new DragButton();
              f.setBounds(200,200,400,400);
              f.setVisible(true);
    class DraggableButton extends JButton implements MouseListener, MouseMotionListener {
         public DraggableButton(String text) {
              super(text);
              addMouseListener(this);
              addMouseMotionListener(this);
         int oldX, oldY;
         public void mousePressed(MouseEvent ev) {
              oldX = ev.getX();
              oldY = ev.getY();
         public void mouseDragged(MouseEvent ev) {
              int dx = ev.getX() - oldX;
              int dy = ev.getY() - oldY;
              setLocation(getX() + dx, getY() + dy);
         public void mouseClicked(MouseEvent ev) {}
         public void mouseReleased(MouseEvent ev) {}
         public void mouseEntered(MouseEvent ev) {}
         public void mouseExited(MouseEvent ev) {}
         public void mouseMoved(MouseEvent ev) {}
         static void p(String s) {
              System.out.println(s);
    }

  • Dragging and dropping components

    Hi
    I have created a component which extendsJButton, but is customised into various different shapes.
    I want to be able to drag and drop this button. I have added mouselisteners and also mousemotionlisteners, but am at a loss as to how to actually move the component.
    When I try to reset the setBounds vcoords using my MouseEvent data nothing is happening
    Thanks in advance

    Hi!
    Here's a small program with a draggable Button.
    Have a look at the class 'DraggableButton'.
    Cheers Tom
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class DragButton extends JFrame {
         public DragButton()     {
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              getContentPane().setLayout(null);
              DraggableButton b = new DraggableButton("Drag me");
              getContentPane().add(b);
              b.setBounds(30,30,100,30);
         public static void main(String args[]) {
              DragButton f = new DragButton();
              f.setBounds(200,200,400,400);
              f.setVisible(true);
    class DraggableButton extends JButton implements MouseListener, MouseMotionListener {
         public DraggableButton(String text) {
              super(text);
              addMouseListener(this);
              addMouseMotionListener(this);
         int oldX, oldY;
         public void mousePressed(MouseEvent ev) {
              oldX = ev.getX();
              oldY = ev.getY();
         public void mouseDragged(MouseEvent ev) {
              int dx = ev.getX() - oldX;
              int dy = ev.getY() - oldY;
              setLocation(getX() + dx, getY() + dy);
         public void mouseClicked(MouseEvent ev) {}
         public void mouseReleased(MouseEvent ev) {}
         public void mouseEntered(MouseEvent ev) {}
         public void mouseExited(MouseEvent ev) {}
         public void mouseMoved(MouseEvent ev) {}
         static void p(String s) {
              System.out.println(s);
    }

  • 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

  • Problem with Drag and drop manager

    I am noticing that the sample provided at
    http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_7.html is not working when tried on any version of FireFox browser on a Mac OS version 10.6.3.
    So my understanding is that there seems to be some problem with the drag and drop manager in Flex when used on Firefox on a Mac OS version 10.6.3.
    It will be very helpful if you can provide any work around for this issue. We want to implement the drag and drop feature in a website that we are building for one of our clients.

    You must be an Oracle employee as you're referring to a component in the upcoming JDeveloper version which has yet been released to the general public. Oracle employee's are, I believe, directed to post on internal Oracle forums.
    CM.

  • Drag and Drop between JTree and another component

    Hi,
    I have searched the forum for answer to this question but am not sure I found something similar to this. So, please help me out on this.
    I have a JTree and a JPanel, which basically shows images (as thumbnails) for the child nodes of one node in the tree heirarchy.
    I need to be able to drag and drop components from the JPanel to the JTree and vice versa, and of course, when you drop them on the tree, they should go under the correct node.
    I am using Swing 1.4.1, and have successfully implemented DnD in the JTree itself. But I am a little unclear about the DnD between the tree and the panel.
    Would really appreciate if someone could throw some light on this.
    Thanks a lot,
    Sri.

    Hi clairesheridan,
    thanks for your response. Your answer would have helped me if I was using JDK 1.3 but I am try to use the Swing API in jdk1.4.1, in which you have to set a transferhandler etc.
    Please let me know if you have any ideas or solutions.
    Thanks,
    sriharmya.

  • Drag n drop components....

    Could I get peoples opinions on a final year project idea please. I was thinking of a MIDP design prorgam for desktop where you drag and drop components(e.g. textfield)onto the screen and the program generates the MIDlet code from the design you made. Has this been done before? Would you find it useful?

    Sorry that you are expecting an answer to decide your direction. Maybe the lack of a response is that (so far) no one needs or is looking for this type of a project. GUI builders tend to restrict developers rather than help in many cases and working with MIDP forms could be one of these cases.
    I my self have developed my own (small) class library to help with the construction of MIDP applications and thus a GUI builder would not benefit myself. But If it helps you and others then go for it.
    The KVM is a very small sub-set of Java developers and this forum is not that well visited to receive a represented sample of what KVM developers want or need.
    Todd Blackley

  • 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.

  • Drag and drop external text into a Flex component

    Hi,
    is there any way to allow drag and drop of external text (for
    example, selected text from another browser or even from the
    address bar) into a Flex component like TextArea? I know how to
    drag and drop between two different Flex components but in this
    case, the source is external. There must be something I can do to
    TextArea like its dragdrop property to allow this feature... any
    help would be greatly appreciated.
    Thanks,
    Josh

    Short answer: Yes, as long as it is an AIR app.
    Browser-based Flex apps do not have access to
    ClipBoardFormats, so I'm not sure it is possible to do what I think
    you want to do -- have a web-based Flex app that allows you to drag
    and drop selected text from other apps. Most possibly because of
    the security sandbox that the Flash player runs in.
    However, if you wanted to do it in an AIR app, I built this
    as an example for you (you can view a "cleaner" version with proper
    indents at
    http://pastebin.com/f741cbac8
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="initDandD();" width="500" height="600">
    <mx:Script>
    <![CDATA[
    public function initDandD():void {
    addEventListener(NativeDragEvent.NATIVE_DRAG_ENTER,
    onDragIn);
    addEventListener(NativeDragEvent.NATIVE_DRAG_DROP,
    onDragDrop);
    private function onDragIn(e:NativeDragEvent):void {
    if(e.clipboard.hasFormat(ClipboardFormats.TEXT_FORMAT)) {
    NativeDragManager.acceptDragDrop(this);
    private function onDragDrop(e:NativeDragEvent):void {
    var myString:String =
    e.clipboard.getData(ClipboardFormats.TEXT_FORMAT) as String;
    myTextArea.text = myString;
    ]]>
    </mx:Script>
    <mx:TextArea id="myTextArea" width="326"
    height="262"/>
    </mx:WindowedApplication>

  • Flex mobile support drag and drop

    According to Adobe's "Developing Mobile Applications in Flex" document it doesn't. But I was wondering if that applies to both mobile phones and tablets, or only to mobile phones. Can this feature be added manually through ActionScript 3?
    Thanks, Norman

    Here's a hack that you might be able to make work for you...
    http://flexponential.com/2011/06/21/using-drag-and-drop-with-a-spark-list-in-a-mobile-flex -application/

  • Implementing drag and drop across components with drag image...

    Hey all,
    Finally got the hang of drag and drop. Not too hard, but a little time consuming. I found an article showing how to capture and drag a BufferedImage within a JTree. When you click and drag a node, it creates a BufferedImage of the node on screen and "ghosts" it a bit, which has a very appealing effect.
    However, when I try to drag this image to a JList component, it disappears. So I created the same affect in the JList component. Now you can drag the image from the tree to the list and vice versa. However, the problem is, the image does not "fly over" the borders of the two components (butted up against each other) with the mouse. The image seems to go under the borders, while the mouse floats above everything.
    What I would like to do is be able to drag the image all over the application, perhaps even the desktop in the case of a SDI application. I want to be able to see this image drag from my Java app over the Windows Explorer folder, just like how you can do that with Windows Explorer, dragging an image of the selected node into any app that supports the drop. I know we can handle the "transfer" data from explorer and vice versa, but how to be able to keep an image with the mouse?
    My best guess is somehow using the Glass pane, grabbing a ref to its BufferedImage (if that is even what is there), and drawing the dragged item in that pane. But, then, how will the image move over the desktop outside of the app, where a glass pane is not?
    Is there a way to draw on top of anything, anywhere, but still be able to redraw the background as the image moves with the mouse? There are times where the image may be big, so I don't want to have to capture the underlying screen as an image covering the size of the drag image to restore it as the drag image moves around.
    Thank you.

    We know cursors support some degree of transparence because they have shapes other than blocks.
    I've done some playing around with
    Toolkit.getDefaultToolkit().createCustomCursor(....);The sad news is, it seems that as soon as a pixel's alpha value is greater than 0, it automatically becomes 100% opaque.
    The best you can do, is to take your image, and divide it into a pixel-checkerboard, and set the alpha value of alternating pixels to 0.
    e.g.
    BufferedImage i = new BufferedImage(32, 32, BufferedImage.TYPE_INT_ARGB);
            int[] data = ((DataBufferInt)i.getRaster().getDataBuffer()).getData();
            boolean on = true;
            for (int z=0; z<data.length; z++)
                if (on)
                    data[z] = 0xffffffff;
                else
                    data[z] = 0x00000000;
                on = !on;
                if (z%32==0) on = !on;
            Cursor hazyWhite = Toolkit.getDefaultToolkit().createCustomCursor(i, new Point(0,0), "hw");

  • ADF Button components: How to disable drag and drop [SOLVED]

    Hi everyone
    I need to develop an application which allows not the user to drag and drop button components. I've converted every single af:commandbutton to h:commandbutton, to prevent this behaviour, but a huge lot of other problems arose from this "solution". I'm using JDeveloper 10.1.3.3.0.4157, and I'm a beginner, so please be patient with me.
    Thanks in advance.

    Maybe I've drifted off-topic with this, but I found the way to achieve this. The only limitation is that the change must be done on the client's computer. The drag and drop feature can be disabled by going to the about:config page in Firefox, and setting nglayout.enable_drag_images to false. It can also be done in a more "portable" way by creating a user.js script in the profile folder and setting it from there. Thank you all for stopping by and reading.

  • Drag and Drop using Components[

    Hi,
    As anyone used Drag and Drop for components? I mean, allowing the user to drag and drop a component around a container? Just curious, so far from what I've seen, the only things that can be dragged/dropped are properties of a given object, such as 'text" from a JLabel.
    thanks

    IMHO, you don't need fancy drag and drop features to do that. Implementing MouseInputListener and listening for mouseDragged is a good start. Then setting the component's bounds depending on the location of the mouse at the mouseReleased event (wrt the starting offset) could be a good idea (if you're using absolute positioning, of course).
    From there, it all depends on what you want it to look like during the "transfer". You could, for instance paint the component in a BufferedImage at the start of the D&D and then paint the image with transparency as the mouse is moving.
    Camickr had an interesting post that might help you :
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=492100

  • Programatic Generation and positioning of  components using Drag and Drop

    Hi,
    I am relatively new to ADF and UI Designing. Im trying to generate a flowchart using drag and drop feature in ADF. This involves creation of dragging images such as start,decision .. etc from one panel to another and dynamically creating a flowchart.
    Up to now i have managed to drag images from panel1 to panel2 and create them dynamically in the bean class. However im stuck at this point .. Im not able to position the draggable components on the desired position in the panelGroup. They either appear horizontally or vertically.
    Is there any way to achieve this. Also is it possible to assign a dropTarget to a a target component which is created dynamically ?
    Thanks in anticipation ....
    Lyle

    Hi Lyle,
    I am too only 4 months old to adf ,i use jdeveloper 10g.
    In 10g for the components to be placed at desired locations i think is somewhat possible. While you can arrange them by using spaces which causes
    f:verbatim tag to appear or you can use ADF Faces Core items like Object Spacer and Object Seperator where you can set their length and width to space objects on page...
    Regards
    Rohit

Maybe you are looking for