Hello,
Can you please support me in the following :
When I drag an externalizable DefaultSingleCDockable , move it on a second monitor and release the mouse,
it disappears. It also causes strange side effects / repaint problems on the application frame in the first monitor.
But if I first click the externalize button on its tab , then I can drag it to the second monitor.
I 've found the following work around in the forums :
final DefaultScreenDockWindowFactory factory = new DefaultScreenDockWindowFactory();
factory.setUndecorated( false );
control.putProperty(ScreenDockStation.WINDOW_FACTORY, factory);
This is working just fine but also places the DefaultSingleCDockable within a dialog with a close button
that does nothing.
I then used something I also found in the forums :
DefaultScreenDockWindowFactory factory = new DefaultScreenDockWindowFactory()
{ //Ensure the dialog's close button will dismiss the dialog
@Override
public ScreenDockWindow createWindow(ScreenDockStation station)
{
final ScreenDockWindow window = super.createWindow(station);
if (window instanceof ScreenDockDialog && !isUndecorated())
{
((ScreenDockDialog) window).getDialog().setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
((ScreenDockDialog) window).getDialog().addWindowListener(new WindowAdapter()
{ //Prevents a memory leak by removing the dialog's station dockable so it doesn't get orphaned
@Override
public void windowClosed(WindowEvent we)
{
((ScreenDockDialog) window).getStation().drag(((ScreenDockDialog) window).getDockable());
}
});
}
return window;
}
};
factory.setUndecorated(false);
control.putProperty(ScreenDockStation.WINDOW_FACTORY, factory);
In which case , the close button does close the dialog but also throws a :
Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException
at bibliothek.gui.dock.ScreenDockStation.drag(ScreenDockStation.java:1052)
when the line :
((ScreenDockDialog) window).getStation().drag(((ScreenDockDialog) window).getDockable());
is invoked.
Ideally , the DefaultSingleCDockable should be able to be dragged to a second monitor without
problems.If this is not possible , it is ok to place it inside a dialog with a close button.
But after I close that dialog , I would like to at least catch this event and be informed that
this DefaultSingleCDockable is no longer visible.
Thanks a lot guys,
George