This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 215743

Summary: Allow Drag & Drop for modal Dialogs
Product: platform Reporter: maxnitribitt <maxnitribitt>
Component: ExplorerAssignee: Jaroslav Tulach <jtulach>
Severity: normal CC: anebuzelsky, geertjan, saubrecht
Priority: P3 Keywords: PLAN
Version: 7.1.2   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description maxnitribitt 2012-07-20 05:23:24 UTC
Perceived Behaviour:

DnD of nodes doesn't work in modal dialogs. I've got a panel with a BeanTreeView and DnD enabled Nodes. DnD works when I put it in a TopComponent or a non-modal dialog. It silently fails when in a modal dialog.

Expected behaviour:

DnD should work in modal dialogs.




My usecase is a custom PropertyEditor which uses an explorerview and node reordering for setting the property.

Bug Analyis:

DnD in modal Dialogs was removed in 2002:

The reason was a bug in  JDK 1.4.0:

"DnD in modal dialogs freezes the JVM in
JDK 1.4.0.  We detect the situation, log it and don't allow DnD.  This
is a bug in JDK which has been fixed for 1.4.1."

Since the bug has been fixed and NB requires at least JDK 1.6, could you replace these lines from ExplorerDragSupport, which prevent using DnD in modal dialogs:

Dialog d = (Dialog) SwingUtilities.getAncestorOfClass(Dialog.class, comp);

            if ((d != null) && d.isModal()) {

            } else {
                dge.startDrag(null, transferable, this);

with something like:
dge.startDrag(null, transferable, this);
Comment 1 Stanislav Aubrecht 2012-07-23 12:22:15 UTC
core-main f72a1fe1bd6d
Comment 2 Quality Engineering 2012-07-24 16:34:33 UTC
Integrated into 'main-golden', will be available in build *201207241500* on (upload may still be in progress)
User: S. Aubrecht <>
Log: #215743 - Allow Drag & Drop for modal Dialogs