Exception after tab remove

1 Merge two panel.
2 Remove one of them to side of it. (Drag from tab)
3 Both panel lost and an exception throwed.

C:\Documents and Settings\skozak\Desktop\New Folder>java -jar bin\docking-frames
-demo-tutorial.jar
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at bibliothek.gui.dock.station.split.SplitNode.getSize(SplitNode.java:80
7)
        at bibliothek.gui.dock.station.split.DefaultSplitLayoutManager.calculate
Divider(DefaultSplitLayoutManager.java:195)
        at bibliothek.gui.dock.facile.station.split.DelegatingSplitLayoutManager
.calculateDivider(DelegatingSplitLayoutManager.java:53)
        at bibliothek.gui.dock.SplitDockStation.drop(SplitDockStation.java:1913)

        at bibliothek.gui.dock.SplitDockStation.access$2300(SplitDockStation.jav
a:187)
        at bibliothek.gui.dock.SplitDockStation$Access.drop(SplitDockStation.jav
a:3525)
        at bibliothek.gui.dock.station.split.SplitDropOperation.execute(SplitDro
pOperation.java:103)
        at bibliothek.gui.dock.control.relocator.DropOperation.execute(DropOpera
tion.java:106)
        at bibliothek.gui.dock.control.relocator.DefaultDockRelocator.executeOpe
ration(DefaultDockRelocator.java:215)
        at bibliothek.gui.dock.control.relocator.DefaultDockRelocator.dragMouseR
eleased(DefaultDockRelocator.java:869)
        at bibliothek.gui.dock.control.relocator.DefaultDockRelocator.dragMouseR
eleased(DefaultDockRelocator.java:771)
        at bibliothek.gui.dock.control.relocator.DefaultDockRelocator$MouseRepre
sentativeListener.mouseReleased(DefaultDockRelocator.java:1155)
        at bibliothek.gui.dock.control.relocator.DefaultDockRelocator$GlobalMous
eReleaseListener.mouseReleased(DefaultDockRelocator.java:1191)
        at bibliothek.gui.dock.control.DefaultGlobalMouseDispatcher.dispatch(Def
aultGlobalMouseDispatcher.java:116)
        at bibliothek.gui.dock.control.DefaultGlobalMouseDispatcher$3.eventDispa
tched(DefaultGlobalMouseDispatcher.java:232)
        at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Unknown So
urce)
        at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Unknown Sour
ce)
        at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Unknown Sour
ce)
        at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Unknown Sour
ce)
        at java.awt.Toolkit.notifyAWTEventListeners(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

*** Edit ***

It looks like this bug and this one are related. KEY_SMOOTH_THEME is causing the issue. After i changed the theme both problems fixed.

Another workaround is consuming mouse event in DefaultStackDockComponent (Line:481). It prevent dragging dockable panel from tab.

Thanks for reporting this bug.

Internally the framework tries to clean up old drag&drop operations whenever it detects a MouseEvent (that is a fix for a bug where an application using Swing does not receive all MouseEvents on Linux and Mac). That cleanup code was a bit too eager, and cleaned up the operation you described. Basically when you released the mouse the operation was cleaned up - and then executed. Of course the order of events is not right here… and that created the Exception.

I wrote a bugfix, that fix is already on Github. I’ll also upload a new version of the framework to the website later this day - but first I have to read the other questions in the forum :slight_smile: