D&D problem since SDK1.4. Dropped object falls through JPanel

Hi,
my application consists of two JInternalFrame.
First frame consists of JTree and JPanel.
Second frame consists of JTextArea.
JTree is DragSource, JTextArea is DropTarget. JPanel-object is neither DragSource, nor DropTarget.
It is possible to drag tree nodes from the JTree and to drop into the JTextArea.
Drag & drop from the JTree into JPanel does not work - as expected.
But it still possible to provide "drag & drop", even if the JTextArea is covered(partly or --completely) byJPanel. That means,that the dropped node "falls" through  the JPanel on the underlying JTextArea.
This phenomenon occurs only since jdk 1.4.
How can I prevent my application from such a behaviour?
Thanks,
Sergey35
import javax.swing.*;
import java.awt.dnd.*;
import java.awt.datatransfer.*;
public class TestDnD extends JFrame implements DragGestureListener,
DragSourceListener,
DropTargetListener
JTree tree = new JTree();
JPanel panel = new JPanel();
JTextArea text = new JTextArea();
JDesktopPane desktop = new JDesktopPane();
JInternalFrame frameFirst = new JInternalFrame("First",true,true,true,true);
JInternalFrame frameSecond = new JInternalFrame("Second",true,true,true,true);
JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,tree,panel);
public TestDnD()
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.getContentPane().add(desktop);
this.setSize(400,400);
this.setVisible(true);
desktop.add(frameSecond);
desktop.add(frameFirst);
frameFirst.getContentPane().add(split);
frameSecond.getContentPane().add(text);
frameFirst.setBounds(0,0,200,200);
frameSecond.setBounds(100,100,200,200);
frameSecond.setVisible(true);
frameFirst.setVisible(true);
DragSource dragSource = DragSource.getDefaultDragSource();
dragSource.createDefaultDragGestureRecognizer(tree,
DnDConstants.ACTION_COPY_OR_MOVE,
this);
new DropTarget(text, DnDConstants.ACTION_COPY_OR_MOVE,
this);
public void dragGestureRecognized(DragGestureEvent e)
Object o =tree.getLastSelectedPathComponent();
StringSelection transObject=new StringSelection(o.toString());
try
e.startDrag(DragSource.DefaultMoveDrop, // cursor
null, // Image image
null, // Point offset
transObject,
this); // drag source listener
catch(InvalidDnDOperationException dnd)
dnd.printStackTrace();
/** DragSourceListener implementation.*/
public void dragDropEnd(DragSourceDropEvent e){ }
public void dragEnter(DragSourceDragEvent e) { }
public void dragExit(DragSourceEvent e){ }
public void dragOver(DragSourceDragEvent e) { }
public void dropActionChanged(DragSourceDragEvent e) { }
/** Implementation of DropTargetListener. */
public void drop(DropTargetDropEvent e)
try
Transferable tr = e.getTransferable();
if(e.isDataFlavorSupported(DataFlavor.stringFlavor))
String string = (String)tr.getTransferData(DataFlavor.stringFlavor);
e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
e.dropComplete(true);
text.setText(string);
else
e.rejectDrop();
catch(Exception ex)
ex.printStackTrace();
}// End drop
/** Implementation of DropTargetListener. */
public void dragOver(DropTargetDragEvent e)
System.out.print(".");
public void dropActionChanged(DropTargetDragEvent e) { }
public void dragEnter(DropTargetDragEvent e) {   }
public void dragExit(DropTargetEvent e) {   }
public static void main(String[] arg)
try
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
catch(Exception e){  }
new TestDnD();

Drag & drop has changed dramaticaly for jdk1.4, the methods you use are obsolete now. Check out the differences: http://java.sun.com/j2se/1.4.1/docs/guide/swing/1.4/dnd.html

Similar Messages

  • Problem Dropping Objects in Oracle XE using PL/SQL Developer

    Hi all,
    I am using PL/SQL Developer to access Oracle XE. I created some tables and later dropped them. But I still see some objects in the PL/SQL Developer Browser under the Tables section.
    Below is the name of the objects in I see:
    bin$fj7zj7y9rhqujmwrz1zmtg==$0,
    bin$frxjknkot4cwtkexm4wtca==$0,
    bin$q2m8wls+s72szfufb+mnzw==$0,
    bin$syrcyj1bsqcelpfsodudrw==$0,
    bin$tjt8ipk6ras8qtx0zvn+6w==$0,
    bin$vc6dzazorg6zwemticqdha==$0,
    bin$xfrxhcb3s5ev8wkjfc/3vg==$0,
    bin$oyrdsi+us+yhhoprzdingq==$0,
    bin$vtk7saqqtecbhmdwpnp1bg==$0,
    bin$x1hhdhy+trmfponyldjwdw==$0
    When I tried dropping these objects, I get ORA - 00933: SQL Command not properly ended. Error deleting bin$fj7zj7y9rhqujmwrz1zmtg==$0
    How do I resolve this problem? And then drop all those objects listed above.
    Is it possible to drop those objects at all?
    Thanks in advance.
    Sam.

    There is no problem sofar. The objects you see are dropped objects ( if you drop it, oracle silently rename the object but preserve it as long you have sufficient space ).
    You shouldn't drop them if you don't have issue with free space - they enable you to get back accidentally dropped table without to have restore the backup ( flashback table). If you are annoyed by displaying it in PL SQL Developer, you can just add a filter to not show them to you ( all objects like 'bin%' ) or you can update to newrer version of PL SQL Developer ( i've 7.0.0.1050 and it is displayed properly, all dropped objects can be found under recyclebin folder ). Finally , if you want purge them, use the 'purge recyclebin' command.
    Best regards
    Maxim

  • Problems since phone restore and upgrade to 3.1.2

    On Thursday I restored my phone to factory settings due to calendar problems when syncing with MobileMe. I set the phone up as a new phone after installing 3.1.2 and the calendar issue resolved. But, since then, I can't get mail from my Exchange server at work and my other e-mail accounts, with the exception of MobileMe, work intermittently and pretty much only if I'm connected to WiFi. The phone doesn't recognize my home WiFi network anymore and I have to enter the password several times in order to connect -- it finally connects after that. Everything else is connecting to my WiFi just fine. Most annoying, however, is that the battery is draining like crazy. I haven't increased or changed the way I use my phone in the last two days -- in fact, I've only made one call and received two others. I've sent a few texts, but no more than usual, and have tried to check e-mail with no to poor results, as I've said. I'm needing to recharge twice daily with little to no use of the phone. The phone is approaching 2 years old -- is the battery simply dying and this exacerbated the problem?? I treat the phone well -- no drops or accidents with it and no such problems until I did the restore. It seems like others have had some problems since 3.1.2, so is that the problem??

    I went to the Apple store today and worked with a Genius on these problems. We're still in a diagnostic mode -- they were able to detect that the battery was going down more quickly but no clue as to why. They suggested restoring the phone one more time and then adding in one app at a time to see if an app is causing the problem, but they don't believe it's related to 3.1.2. Right now, my phone has nothing on it except for MobileMe and it seems to be holding a charge. It's still draining a bit more quickly than it did before 3.1.2 but as I add in more apps, I'll be able to determine what's causing the issues. Frustrating!

  • Ps CS6 Problem: Transform applied to Smart Object fails to transform an attached Smart Filters Mask

    Ps CS6
    OSX 10.6.8
    Problem: Transform applied to Smart Object fails to transform an attached Smart Filters Mask.
    I mean a Transform, including Free Transform, as found in the Edit menu.  A simple move by the Move Tool is OK.
    A workaround until this bug is squashed is to encapsulate the Smart Object + Smart Filters + Filter Mask inside another Smart Object and transform that.
    However, that will not be a satisfactory solution in some cases. If a filter has size parameter(s), e.g. Gaussian Blur radius, a scaling or warping/distorting transform applied after the filter will obviously differ from the filter applied after the transform.
    In any case, the workaround is inconvenient to subsequent editing and experimenting with filters and masks.

    R_Kelly wrote:
    I don't think that's a bug since the implementation seems to be purposely done.
    It's been that way since photoshop cs3.
    If its been like that since CS3 then I think it's a bug which remains because nobody (or not enough people) has complained before.

  • Database copy dropped objects in source schema

    I was seeking out a quick way to copy an entire schema from one db to another and I was happy when I found the "database copy" feature. I checked the documentation and found that all I needed to do was select the source connection, the target connection, and choose either create, truncate, or drop objects. Well I had some objects in the source db from a previous failed attempt at copying all the objects via script. To remedy that the drop objects option, according to the documentation " Drops any existing table with the same name, and then creates and loads it from the source." Ok, great. The summary shows up with a bunch of entries which I didn't pay too much attention too. Fine, continue...running....progress...so far so good..and the log shows up. I see drops, I see moving data, and I see a whole bunch of errors with no useful information with them. Check the target schema...nothings there, all objects are dropped. Ok, lets have a look at the source and see whats going on. Refresh tables...nothing...refresh...refresh...nothing. The source schema has all its objects GONE too! One lonely type is saved in the source schema, that's it. Am I a total moron and misinterpreting how database copy works? Can anyone shed some light on this? Anyway to recover my source objects? As the source db is not production I am out of luck as there is no recent backup.
    Source: 9i
    Target: 11g
    sql developer v 2.1.1.64.45
    -j

    OK the problem was that my target connection was inadvertently pointing to the source. It was set properly before but stuff went bad and i switched the connection from TNS to basic, then back to TNS. Apparently when switching back to TNS the wrong entry was selected. Not sure if I chose it or it was selected from a different connection. In any case, very stupid of me.
    thanks K.
    Edited by: [email protected] on Jun 17, 2010 6:45 AM

  • Rollover text on a drag and drop object

    Hi folks, I wondered if someone could help me with this
    problem. Last week I was adding text to a drag and drop object on
    the press of a button and release of a button. This week, I am
    trying to get the drag and drop object to reveal text when the
    mouse rolls over it and again when the mouse releases it. I thought
    it should be pretty easy to fathom out the script for this, because
    I was given a lot of help last week. But I put in the attached
    code, and the object does not drag and drop, and neither does it
    show any text when the mouse rolls over it and off it.
    Can anyone tell me what I am doing wrong?
    Thanking you,
    Marchan

    The script I posted would work on the main timeline - not in
    the timeline of the clip itself.
    So you made a movieclip out of the image and gave it the
    instance name "myclip". That's good.
    You edited that clip and added a dynamic text box with
    instance name "mytext". Be careful not to confuse the "instance"
    name of the text box with the "Var:" name. "myclip" should be the
    instance name. Also be careful to make sure you uncheck the
    "selectable" box. Edit your clip and click on the textbox to select
    it and look in the properties panel. There should be a button with
    Ab on it. If it is white background (highly likely), click it so it
    is not white. If the text is selectable, it will interfere with
    your button functions.
    While there is nothing wrong with creating nested clips
    within your movieclips, unless you plan to target them for
    something, there is no benefit. The only thing that needs an
    instance name inside the myclip is the textbox (based on what you
    are trying to do).
    You don't need any actionscript in the movieclip itself. If
    you can learn to place all your AS on the root timeline, you will
    be well ahead.
    If you placed that AS inside the clip, Flash wouldn't know
    what to do with it.
    Technically you can place the AS inside the clip on the layer
    you created but, if you did that, you would need to modify the
    script to the following:
    this.onPress = function() {
    this.mytext.text = "stop pressing so hard";
    startDrag(this);
    this.onRelease = function() {
    this.mytext.text = "";
    stopDrag();

  • Cannot drag and drop objects

    I starting having an issue with dragging/dropping objects on my screen a few days ago with my Macbook Pro. Say, for instance, there is a document on my desktop that I want to move to another location on my desktop or to a folder...when I left click on the document, a ghost of it appears on my cursor...I can move it around, but I cannot drop it. It takes several hits of the ESC key and clicks of the left mouse button to return the cursor to it's normal state, which also causes the ghost of the object to rush back to the original object icon instead of where I want to drag it. It does not matter if I use the touch pad on the laptop, my wireless house, or my wired mouse, which tells me it is a system issue and not a hardware issue. I am using 10.6.8. I have not voluntarily changed any mouse or desktop settings at all. I also noticed that when I move my cursor to the top left corner, it does not put the computer in a screensaver mode as I have it set up to do. I checked the screen settings and it is still set up to go to the screensaver when I move the cursor to that location. Does anyone know how to fix this?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find nothing has changed after you complete it.
    Enable guest logins and log in as Guest. For instructions, launch the System Preferences application, select “Help” from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    As Guest, try the action. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.

  • Hello I have a problem since my installation of the Yosemite update on my Mac I can longer open Indesign CS6

    Hello
    Hello I have a problem since my installation of the Yosemite update on my Mac I can longer open Indesign CS6.
    I have a problem since my installation of the Yosemite update on my Mac I can more open Indesign yet I have installed JavaForOSX2014-001 but it has changed nothing someone could help me?

    Please do not post the same question multiple times. If someone can help you, they will, but you need to be patient -- we're all just volunteers, users like yourself. I'm going to delete your other posts.

  • USB problems since EFI firmware update 2.6

    My MBA has been suffering USB problems since this update.
    I have an IOGear USB 3 GUH374 hub.  I connect my iPad mini and USB 3 disk to it.
    Since the update, the iPad has stopped charging through the hub.  Now, I can't find the power specs of the hub, so I don't know that it should work, but it was working fine.  Now, the iPad says "not charging".
    The USB disk has spontaneously disconnected a few times, with the system reporting that it was improperly disconnected.  One time, the disk was corrupted.
    This could be a coincidence, so I've contacted IOGear.  But, I'm also having new, different, sleep problems with the MBA and Mountain Lion.
    ==Leonard

    Sitongia
    This is a user community, it is not Apple.
    If you wish to thank Apple, here is the feedback link for iPad.
    http://www.apple.com/feedback/ipad.html

  • Problem with Drag and drop in panel dashboard

    Hi
    I am having problem with drag and drop in panel dashboard.
    I will explain what i am doing.
    I am using Oracle three column template in First region i am having a table that showing all customer.
    I drag one record from my table and drop it on customer info (CIF) page on second region it is working fine.
    my CIF page has a dashboard with 6 panel box. i am showing 6 different jsff in 6 panel box.
    I put drop target in each jsff
    <af:dropTarget dropListener="#{backingBeanScope.backing_customerinformation.handleItemDrop}"
    actions="COPY">
    <af:dataFlavor flavorClass="org.apache.myfaces.trinidad.model.RowKeySet"
    discriminant="CustomerSearchDnD"/>
    </af:dropTarget>
    when i put drop target my panel boxes moves only when i drag it to another panel box header not entire part of panel box.
    if i remove the drop target then panel box move normally as the example given on: [http://adfui.us.oracle.com:7778/faces-trunk/faces/visualDesigns/dashboard.jspx?_afrLoop=2021391022520156&_afrWindowMode=0&_afrWindowId=null] but in taht case i am not able to drag and drop my data

    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.

  • I am using only one Apple ID. The problem, since iOS 6,  is the App Store purchased items screen just shows loading screen  it finally crashes or gives the error message 'can not connect to  Apple store'

    I am using only one Apple ID. The problem, since iOS 6,  is the App Store purchased items screen just shows loading screen  it finally crashes or gives the error message 'can not connect to  Apple store'

    I am using only one Apple ID. The problem, since iOS 6,  is the App Store purchased items screen just shows loading screen  it finally crashes or gives the error message 'can not connect to  Apple store'

  • HT1338 Hi everybody..i have an enigmatic problem since i bought MacBook Air..i can't watch youtube videos and i did install the latest adobe flash player BUT when i start to install it the system keeps asking me to enter a password ? which password i need

    Hi everybody..i have an enigmatic problem since i bought MacBook Air..i can't watch youtube videos and i did install the latest adobe flash player BUT when i start to install it the system keeps asking me to enter a password ? which password i need ??????

    Your admin account password.

  • Many problems since the update - help?

    Hi all,
    Let me start by saying that I am, for all intents and purposes, a huge Apple booster. I have a new 24" iMac. I have an Airport Extreme. I have an iBook G3 I use for travel (I'm a journalist) and recently handed down my old G3 iMac to my son after loading it up with RAM. I extoll Apple products because they are elegant and simple, and a pure pleasure to use.
    Unfortunately, this hasn't been my experience with Apple TV since the 2.0 update.
    My problems since the update include:
    1) My Apple TV regularly "hangs" when trying to connect to ATV content. About 50% of the time when I try to play a song or podcast or movie preview -- whatever -- instead of connecting to it, I'll get an "Accessing iTunes Store" message which, after about 30 seconds of the little spinning icon, will inevitably revert to "The iTunes Store is currently unavailable. Try again later." I have to "back out" of the submenu (e.g., "Movies" or "Podcasts" or "TV Shows"), and enter another, different submenu before it will connect. I've tried all combinations of Airport settings ( both 2.4 Ghz and 5Ghz N, mixed b/g/n), and many different channels, but this keeps on happening. I have troubleshot my network connection with my ISP, and have tested the integrity of the line at DSL Reports. The connection and line quality is fine. Connection strength: signal = 54; noise = 92. In other words, decent.
    2) When attempting to play HD Trailers, it is now hit and miss whether or not they will load. Instead of a blue progress bar, my screen goes black for about 15-20 seconds. (During this time, I cannot exit out of the action by pressing 'menu' on my Apple remote; it is effectively unresponsive.) After the 15 seconds or so are up, I get the following message: "Selected content is not available. Format is not recognized" -- or something close to this. After I exit, play an SD trailer, and then hit into the same trailer again, it will often (but not always) work.
    3) Album cover art flips often "stick" when turning, especially when playing songs with long, scrolling titles. (I spent a lot of time on the phone with an Apple TV Product Specialist and, after he replicated the issue, he passed on his findings to the Apple Engineering. It is, I was informed, not high on their list of priorities
    4) Unplugging and then replugging the ATV to reboot causes a small electrical spark. Needless to say, I don't tempt fate by doing this any more, and instead use the "-" and "menu" restart method.
    All in all, a very disappointing experience of late. Very un-Apple.
    By the way, connecting to YouTube videos and Flickr contacts ALWAYS works. No problems at all with any non-Apple site accessed through the ATV. So the problem lies with Apple.
    Is anyone else experiencing similar difficulties? I'm at my wit's end with this thing. Never thought I'd be saying that about an Apple product. But I want to try and solve it, so I'm asking for help. If nothing can be done, I'm going to ask Apple to replace it, or return it.
    Thanks in advance for your thoughts.

    Rick Rouse wrote:
    Trust me you are not alone. Apple's "not high on their list of priorities" response is outrageous.
    That was a paraphrase. The exact words, I'm afraid, I didn't write down. I wish I had, though. It was truly a beautiful example of corporate bafflegab. Something like: "since this only affects the visual aspects of the unit and not its overall performance" -- I told the (very nice) product specialist that the Apple TV was pretty well ALL AND ONLY about visuals. (FWIW, he agreed.) Anyway...

  • IPhone 6 will not sync music. This has become a problem since using itunes 12. It also will not sync all my pics and video's with my iPad 4  either. Removed and re-installed iTunes with no improvement.

    iPhone 6 will not sync music. This has become a problem since using itunes 12. It also will not sync all my pics and video's with my iPad 4  either. Removed and re-installed iTunes with no improvement. It stops at last step saying waiting for items to copy and just sits there.  The iPad finish the sync, but some video's are missing.

    iPhone 6 will not sync music. This has become a problem since using itunes 12. It also will not sync all my pics and video's with my iPad 4  either. Removed and re-installed iTunes with no improvement. It stops at last step saying waiting for items to copy and just sits there.  The iPad finish the sync, but some video's are missing.

  • Sniffer Result Code: 3 / CUDA-Problems since Mavericks update

    Hey Guys, first, thanks a lot for helping / or checking this out.
    I have this problem since upgrading to Mavericks from Mountain Lion.
    After upgrading I noticed there is a CUDA-Panel in my System prefs - which was new to me, having the classic onboard ATI Radeon of my MacPro.
    Starting After Effects since then results in:
    Last log message was: <140735271506704> <GPUManager> <2> Sniffer Result Code: 3
    Generating crash log, which may take a few minutes.
    then OSX tells me AE has stopped working.
    System Specs:
    MacBook Pro
    15 Inch,
    Late 2011,
    AMD Radeon HD 6750M 512MB,
    OSX 10.9.2 (13C64)
    So it's the classic on Board graphics card and nothing NVIDIA/PC-fancy.
    What I've done so far:
    Installed newest CUDA-Version (even though, the system prefs plane tells me it needs an update, even when downloading the newest from NVIDIA)
    Deinstalled and installed the whole CC-Suite, cleaned it, made a new admin-user, deinstalled again, installed on the news user (same problem), installed on the old one.
    CUDA-drivers deinstalled from within the terminal (killing all relevant NVIDIA.kext and GeForce.bundle files), rebuild the extensions files with kext-utility.
    Used disk-utility in the system and by rebooting with COMMAND+R, checked the volumen and the permissions, nothing Adobe relevant came back.
    I'm kinda very stuck here...
    Any help would be very welcome.
    Thanks

    The problem is that you installed CUDA software on a computer that has no CUDA-capable hardware. Don't do that.
    You must remove the CUDA framework from your computer. See the last part of this article:
    http://blogs.adobe.com/kevinmonahan/2014/03/19/avoid-installing-nvidia-cuda-drivers-on-com puters-with-amd-gpus/

Maybe you are looking for