DND (drag / move) and listeners

I want to drag a JComponent with all its properties and the Auditors.
How can drag you listeners registered to a component when you perform a drag-and drop?

I have an extension of a JTextArea. I got drag and drop it into another container.
After release, some of the listeners don't work anymore.
I can cope with headphones I've added manually, but not initialized or added somewhere else during initialization of the component.

For example, I have the following 3 headphones on JTextAre:
dot = 0, class = 0 javax.swing.text.JTextComponent brand $MutableCaretEvent
javax.swing.plaf.basic.BasicTextUI$DragListener@25cbfa42 class javax.swing.plaf.basic.BasicTextUI$ DragListener
Dot = (0, Forward) Mark class javax.swing.plaf.basic.BasicTextUI (0, forward) = $BasicCaret

After release, the new component has 4 listeners, the MutableCaretEvent is double and one of the two no longer receive events.
dot = 0, class = 0 javax.swing.text.JTextComponent brand $MutableCaretEvent

If I drag and drop the JTextArea autour, for every drop of the number of listeners of MutableCaretEvent increases. If I drag the JComponent about 10 times for example,
I'll have 11 MutableCaretEvent listeners.

So my questions are:
1 - How can I remove the MutableCaretEvent that no longer work?
2 - should that other listeners I care? How 'Add' those who eventually doesn't work anymore after the decline?
3-is there a way to move a JComponent from one container to another without going through the process of serialization (drag / move)?

Thank you

Published by: 849866 on April 5, 2011 03:34

Published by: 849866 on April 5, 2011 03:35

What is even work considered less listeners? It seems that you remove the component in exportDone of the target component. Also, you must call revalidate(); Repaint(); on the container if dynamically add you items.

I don't know if the serialization uses the default constructors. If he does it would add additional listeners. You might want to just export the reference to the component (mimetype localObjectRef or something like).

Please do a NBS (simple chassis, two panels and a text box to slide between them).

Tags: Java

Similar Questions

  • Drag / move - how to reset the feedback?

    Hello

    I have a drag and drop into a slide (Captivate 7).

    Problem: I need your feedback an interaction drag-and - drop is reset whenever the learner back to the slide / move later.

    Background: Learners complete the drag / move and gets feedback "Correct!" or "Incorrect". The learner then continues the lesson on the way to the next slide. The problem is that, if the learner is returned for drag / move, 'Okay!' or 'Wrong' feedback still shows that the drag source items are reset to their original locations and the learner can repeat the interaction drag-and - drop. By clicking on the button "Reset" does not remove the existing 'Correct '! or feedback "incorrect." Even if the learner restores the interaction and the opposite effect (for example if the learner is wrong the first time, but then correct themselves the second time), the existing comments don't change e.g. 'Wrong' to 'correct '.

    Any ideas on how to solve this problem?

    Thank you!

    It worked!

    I had to also run the tip at the entrance Action, not just at the exit. Weird, but hey, it worked!

    see you soon

  • I've lost the ability to copy files on my CD player. When I drag and drop, the only authorized action is 'move' and it does not work.

    I've lost the ability to copy files on my CD player.  When I drag and drop, the only authorized action is 'move' and it does not work.   I tried press and hold the CTRL key while dragging, and when I do that all the other disks show "copy" as the default action, but when I hover over the action CD player available only changes to 'pass '.   I ran the Microsoft Troubleshooting tool for CD/DVD players and he said that the media were not writable, but there is a blank CD in the drive.  Any ideas on how to solve this problem?

    Thanks, but the cd/dvd drive works well - I can burn a cd with windows media player for example.  the problem is that I can't copy files to it.   I can play CDs (haven't checked the DVD).  I can not do and could do before, is doing drag and drop files on it.  The only authorized action is "move".   This happens even when I click CTRL + do drag.   I can copy it to any other player, but the CD player, and when I hover over the "exemplary" drive CD goes to 'move '.

    have you tried using a different suite of cd/dvd burning?

    Imageburn is free and easy to use: http://download.imgburn.com/SetupImgBurn_2.5.7.0.exe

    There may be something to play with your access keys if you have a (ie., wirekeys)

  • Drag / move in libraries and nothing appears in the library

    I opened a document in illustrator and drag and item in the library and nothing appears in my library panel?

    Hi Ausmack,

    This is a problem known to the Illustrator team with a certain configuration of operating system (studied at the moment) the behaviour of drag - move in the design in artificial intelligence Library Panel does not work.

    Until then, you can try adding the asset using the buttons/icons that appear at the bottom of the Panel "libraries."

    Thank you best regards &,.

    Rambour

  • Drag / move does not work

    Windows Explorer - updated my computer with the latest updates of Windows XP on February 26 - since then the function drag / move on Windows Explorer (and my office) didn't work. I did a scan full antivirus and came out the own. Also checked the properties of the task bar and Start Menu and confirm the Drag and Drop check box is checked. No new hardware recently added with the exception of an APC battery backup. Suggestions for remedies?

    Hello

    1. have you made changes on the computer recently?

    Method 1.
    Let us first start the sfc scan and check if there are any file system corruption.
    a. to do this, click Start, click programs, accessories principally made, right click Guest and then click Run as administrator. If you are prompted for an administrator password or a confirmation, type the password, or click on allow.
    b. type the following command and press ENTER:
    sfc/scannow
    The sfc/scannow command. analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions.
     
    More information on SFC scan found in this document:
    Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe)
    http://support.Microsoft.com/kb/310747

    Method 2.
    If the problem persists, then create a new user profile and then copy your current users assigning to this profile. For more information, see:
    How to create and configure user accounts in Windows XP
    http://support.Microsoft.com/kb/279783

    How to copy data from a corrupted to a new profile in Windows XP user profile
    http://support.Microsoft.com/kb/811151

    How to recover damaged Windows XP user profile
    http://support.Microsoft.com/kb/555473

    I hope this helps.

  • Cannot drag move & on win7 x 64 programs

    Hello, I need help on why I can't do drag & drop of images/files on programs such as Photoshop CS5 / CS6 or images/files to other programs & browsers.
    I CAN do drag & drop under windows and folders, etc, but not in the programs. I read almost all the solutions found here and on Google without success. I went from keyboards and mouse still nothing, checked the settings in the menu start-star & options in IE8, cleaned the registry with ccleaner, I tried the keys ESC and combo but again without success.

    It is a new installation of Windows 7 ultimate with the latest drivers from the website or x 64. I have a Windows 7 x 86 as well (same setup with the x 64) and I can do all the drag & drop on it.
    This bothers me because I do a lot of hanging around in photoshop and other editing software.

    Thank you very much in advance.

    Hello

    1. what happens when you try and drag - move?
    2. This involved for other users on the computer?

    Method 1:

    I also suggest a clean boot to see if a third-party program has been installed and that it interferes with the operating system.
    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135
    Note: after a repair, be sure to set the computer to start as usual as mentioned in step 7 in the Knowledge Base article.

    Method 2:
    In Photoshop CS5 a new image opens as a new layer, and not as a new document. For example, you can create a document in Photoshop, first, and then see if drag - déposer works.

    Method 3:
    Try to create a new user account to see if the same behavior occurs.
    http://Windows.Microsoft.com/en-us/Windows7/create-a-user-account

  • Drag / move too easy to lose files

    Some of my colleagues are a little loose with drag them and drop which means that files are lost by mistake.  I suggested that they do a right-click to get the possibility to cancel, but is there a place to force a pop-up window asking if you really want to say to move or copy an option?  THX

    You can set it so that it requires a longer brake actually causes wildfire to occur.  Normally if you click and hold an icon, and begin to drag, you move 4 pixels before it actually starts dragging.  You can change this to a larger number so that it requires a very deliberate movement until it starts to drag.

    Here's how.

    ATTENTION: Always backup the resistry before making any changes. To do this in the registry editor, select file/export. In the scope of the export, all options you select. Save the file to the desktop. If something goes wrong, you can right click on this file to restore the registry.

    1. Press on the + R to bring up the Run dialog box. Type regedit.exe in the Open box, and then click OK.
    2. Navigate to the following key.

      HKEY_CURRENT_USER\Control Panel\Desktop

    3. In the right pane, find the following.

      DragHeight and DragWidth. These two values will have a value of 4data.

    4. Right-click each of these values and select Edit. In the value data box, type 20 click OK.

    You will need a Log Off/Log on to see the results.

    Test the new setting to see if it works for you. If 20 does not work for you, increase the value 30, etc., until you find the setting that your satisfaction with.

  • Why if alpha tween move and resize symbols?

    Why if alpha tween move and resize symbols?

    I am wanting a graphic element to fade as it changes shape - shape went very well, but the alpha slider starts moving the shape around the stage!

    Is this a classic Tween?  Images key with irregularly placed points of alignment can cause problems like that, if you want to be sure that the registration point is in the same position in two key frames.

    To move the anchor point, use the transform tool to select your symbol; Then click and drag the little white circle... it must be aligned on Center & edges.  Make sure that it is in the same place on all chassis.

  • Can't see the dimensions for drag - move to create dataforms: Oracle EPMA planning

    I m trying to create a "simple dataform" but cant seem to find the dimensions for drag - move so I can create it. I can see dimensions in the Pan "POV", but nothing in the pots line and column as you can see in the screenshot.

    Screenshot from 2014-10-28 14:20:43.png

    I missed something?

    would appreciate any suggestions,

    I got it. We are supposed to drag and drop dimensions using the icon

  • Drag & drop and right click to stop work in Premiere Pro

    Hello!

    We use Adobe Premiere Pro in the business for a while now. Only today it began to happen that first would completely freeze on the attempt to drag and drop a file in sequence. Drag / move cursor would remain same after the release of the left mouse button and the interface user of first overall would freeze. Here is an example of what is happening: https://youtu.be/hXbBY342HLI

    It is the latest version of Premiere Pro. I tried to clean the Adobe programs and settings power off the PC completely and everything reinstalled again. It does not solve the issue.

    This problem will not occur in all the projects that I noticed. But I don't see anything in common between the projects in which what happens.

    Does anyone have a similar problem?

    Try to delete the sequence markers In/Out.

  • How can I recover the functions drag horizontal and vertical to center the portions of the image being developed? [was: Question]

    How can I recover the functions drag horizontal and vertical to center the portions of the image being developed?

    1 - question double deleted

    2 the name of the program you are using then a moderator may move this message to the correct program forum

    This forum Cloud is not on the program problem... help a program would be Photoshop Lighroom or Muse or?

  • Drag / move image is duplicated

    Hello

    In my code, I want to drag an image in a list populated from a folder, and its information are filled with an xml file. Now, I can drag the image in the list and drop it into the container, however, when now, I want to drag around the deleted image, it is duplicated, an extra image is created in the Web. So, if someone can tell me how not to create an additional copy of the image in the new container (canvas) that he was dragged in.

    Here is the code:

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="vertical" "

    name = "Drag and Drop tutorial"

    creationComplete = "init ()" "

    initialize = "pictureService.send ()" >

    < mx:Script >

    <![ CDATA [ ]

    import mx.controls.Image;

    import mx.core.DragSource;

    import mx.core.IUIComponent;

    import mx.managers.DragManager;

    import mx.events.DragEvent;

    import mx.controls.Alert;

      

    import mx.rpc.events.FaultEvent;

    import mx.rpc.events.ResultEvent;

    import mx.collections.ArrayCollection;

    [Bindable] private var pictureData:ArrayCollection;

    private void resultHandler(event:ResultEvent):void {}

    pictureData = event.result.data.image;

    }

    private void faultHandler(event:FaultEvent):void {}

                //code

    }

    public void init (): void

             {

    / / a mouseDown event will begin the drag

            

    list.dataProvider = pictureData;

         

    //picture in the list is moved

    this.picture.addEventListener (MouseEvent.MOUSE_DOWN, beginDrag);

    / / accept drag - move...

    this.area.addEventListener (DragEvent.DRAG_ENTER, acceptDrop);

    / / treatment of gout...

    this.area.addEventListener (DragEvent.DRAG_DROP, handleDrop);

             }

            

    function public beginDrag (mouseEvent:MouseEvent): Sub

    {

    / / the initiator of the drag is being moved (target of the mouse event)

    var dragInitiator:IUIComponent = mouseEvent.currentTarget as IUIComponent;

         

    / / the drag source contains data which is moved

    var dragSource:DragSource = new DragSource();

         

    / / Add data to the object.


    dragSource.addData (1, 'value');

                 

    / / Create a copy of the piece to use as the drag proxy image.

    var dragProxy:Image = new Image();

    dragProxy.source = mouseEvent.currentTarget.source;

    dragProxy.setActualSize(mouseEvent.currentTarget.width,mouseEvent.currentTarget.height)

         

    / / ask the DragManger to start drag

    DragManager.doDrag (dragInitiator, dragSource, mouseEvent, dragProxy)

    }

    acceptDrop (dragEvent:DragEvent) of the public service: Sub

       {

    var dropTarget:IUIComponent = dragEvent.currentTarget as IUIComponent.   

    / / accept the fall

    DragManager.acceptDragDrop (dropTarget);

    / / post your comments

    DragManager.showFeedback (DragManager.COPY);       

       }

      

    handleDrop (dragEvent:DragEvent) of the public service: Sub

       {

    var dragInitiator:IUIComponent = dragEvent.dragInitiator;

    var dropTarget:IUIComponent = dragEvent.currentTarget as IUIComponent;

         

    If (dragEvent.dragSource.hasFormat("items"))

      {

    var table: items = dragEvent.dragSource.dataForFormat("items") as array;

    var img:Image = new Image();

    img.x = dragEvent.localX;

    img.y = dragEvent.localY;

            img.width = 50;

            img.height = 50;

    img.source = "' assets / ' + points [0] user.user +".jpg"; "

    img.addEventListener(MouseEvent.MOUSE_MOVE,beginDrag);

           

    area.addChild (img);

       }

       else

       {

    dragEvent.dragInitiator.x = dragEvent.localX

    dragEvent.dragInitiator.y = dragEvent.localY

       }

           

       }

      

    ]]>

    < / mx:Script >

    < mx:HTTPService id = "pictureService".

    url = "" data / data.xml " "

    result = "resultHandler (event)" "

    fault = "faultHandler (event)" / >

    < mx:DataGrid id = "list" = "238" height = "200" width = "26" x = "10" labelField = 'src' dragEnabled = "true"

    dataProvider = "{pictureData}" >

    < mx:columns >

     

    < mx:DataGridColumn dataField = "id" id = "code" >

     

    < / mx:DataGridColumn >

    < mx:DataGridColumn id = 'image' draggable = "true" >

    < mx:itemRenderer >

    < mx:Component >

    " < mx:Image source="assets/{data.id}.jpg "/ >

    < / mx:Component >

    < / mx:itemRenderer >

    < / mx:DataGridColumn >


    < / mx:columns >

    < / mx:DataGrid >

    < mx:Canvas id = "space" x = "266" y = "28" width = "436" height = "401" backgroundColor = "#c0c0c0."

    dragDrop = "handleDrop (event)" > "

    < / mx:Canvas >

    < / mx:Application >

    your handleDrop is called twice. you have assigned this twice - init function and the other online eventlistener.

    remove one and it works.

  • The storage objects and listeners (base)

    A wannabe-AS3 newbie question. My problem (I think) removes unwanted objects and listeners that I switch from one mode to another in my project... Although my difficulty behind which is probably insufficient understanding of the basics of the display list.

    In a "mode" of my project, I generated the following structure:
    1... sprite ("reviewPage");
    2a......... Some graphics on reviewPage
    2b......... TextField ("commentBox");
    2c......... A number of Sprites ("displayCard_1", "displayCard_2"... "displayCard_n");
    3a............. Some graphics on each displayCard;
    3b............. Multiple EventListeners on each displayCard (e.g. displayCard.addEventListener (MouseEvent.CLICK, gotoReviseCardMode, false, 0, true))
    3c............. TextField (questionBox_1 ""...) "questionBox_n");
    3d............. TextField (equationBox_1 ""...) "equationBox_n");
    3e............. TextField (answerBox_1 ""...) "answerBox_n").

    One of the eventListeners attached to each Sprite displayCard calls a tidy supposed to function, unwanted objects and eventListeners and then move the activity to another mode, defined by another function.

    There is only one child on the stage. I guess this will be my reviewPage with all the objects it holds. However when I draw it, and it's name, I get 'root1 [object MainTimeline] ". With the help of stage.removeChildAt (0) removes all visible objects in the display list and left me without children on the scene.

    I tried to 'Explorer' my structure by writing a small function to identify each object/container and the hierarchy of the objects attached to them... but have been spectacularly failed in this effort and still overwhelmed by the error messages.

    I have a couple of issues / questions:
    1. can I remove all eventListeners when I stage.removeChildAt (0)?
    2. do I still need to remove these objects from memory? If so, how? How can I explore what listeners and objects use memory after I tried a cleaning like that?
    3. How can I remove one of the TextField objects, say answerBox_212, or one of the eventListeners attached to one of the "displayCard" Sprites, the list display and memory?

    Any guidance would be greatly appreciated.

    See you soon
    Dougal

    A wannabe-AS3 newbie question. My problem (I think) removes unwanted objects and listeners that I switch from one mode to another in my project... Although my difficulty behind which is probably insufficient understanding of the basics of the display list.

    In a "mode" of my project, I generated the following structure:
    1... sprite ("reviewPage");
    2a......... Some graphics on reviewPage
    2b......... TextField ("commentBox");
    2c......... A number of Sprites ("displayCard_1", "displayCard_2"... "displayCard_n");
    3a............. Some graphics on each displayCard;
    3b............. Multiple EventListeners on each displayCard (e.g. displayCard.addEventListener (MouseEvent.CLICK, gotoReviseCardMode, false, 0, true))
    3c............. TextField (questionBox_1 ""...) "questionBox_n");
    3d............. TextField (equationBox_1 ""...) "equationBox_n");
    3e............. TextField (answerBox_1 ""...) "answerBox_n").

    One of the eventListeners attached to each Sprite displayCard calls a tidy supposed to function, unwanted objects and eventListeners and then move the activity to another mode, defined by another function.

    There is only one child on the stage. I guess this will be my reviewPage with all the objects it holds. However when I draw it, and it's name, I get 'root1 [object MainTimeline] ". With the help of stage.removeChildAt (0) removes all visible objects in the display list and left me without children on the scene.

    I tried to 'Explorer' my structure by writing a small function to identify each object/container and the hierarchy of the objects attached to them... but have been spectacularly failed in this effort and still overwhelmed by the error messages.

    I have a couple of issues / questions:
    1. can I remove all eventListeners when I stage.removeChildAt (0)?
    2. do I still need to remove these objects from memory? If so, how? How can I explore what listeners and objects use memory after I tried a cleaning like that?
    3. How can I remove one of the TextField objects, say answerBox_212, or one of the eventListeners attached to one of the "displayCard" Sprites, the list display and memory?

    Any guidance would be greatly appreciated.

    See you soon
    Dougal

  • I rented a movie and I can not watch and has already been charged

    I rented a movie and I can not watch and has already been charged

    Expect to be charged when you choose to rent, not some time later. Why can not watch you? Error messages? What version of Apple TV do you have? See if anything in this collection of Apple TV support documents and user guides help.

    TT2

  • iMovie 10.1.2 today (June 4, 2016), all of a sudden will not let me create a new project/film.  1. I have used the program extensively in recent weeks, many small travel films. 2. once in the projects, if create a new movie and the sign is checked, the op

    1. I have used the program extensively in recent weeks, many small travel films.

    2. when in the projects, if you click on create a new movie and sign, the new movie and trailer options opens successfully.

    3. click on film, nothing goes very well but open trailer.

    4. the issue seems to be the only new film/project.

    5. I can access all my other movies and run successful projects and theatre.

    6. I tried through a previous project and clicking new project from the menu, but still nothing.

    7 mac is 27 "OS X El Capitan, Version free 10.11.5, with 327 GB to 999 GB

    iMovie is 10.1.2

    8. the computer itself did not fall down and as FAS as I know, all other programs work correctly.

    9. I rebooted several times, but that has not solved the problem.

    10A does anyone else have this problem? If so, how do fix you it?

    Thanks much for any help!

    Have you ever tried to delete the iMovie preferences?  If the elements of the user interface do not, deleting preferences frequently you contribute.

    To delete the iMovie preferences leaving iMovie, runs, and then press and hold options and command key at the same time, at the launch of iMovie. Keep now pressed the buttons firmly until you see a command prompt to remove the preference. Confirm.

    Before you do, take note of all the settings that you made in iMovie preferences panel, so you can put back them later. iMovie will then begin with the Welcome screen.

    When I had a similar problem, the only thing that helped was to create an iMovie library.  Probably a corrupted in the iMovie project current library prevented the creation.   The problem persists, if you test different library in iMovie? You can create a library for testing.

    http://help.Apple.com/iMovie/Mac/10.1/#/mov3fa25bae7

Maybe you are looking for