Hello.
I am testing DockingFrames with a small demo program based on the tutorial provided.
I am experiencing an issue I believe is due to developing on a machine with two displays.
When I run my test demo, it comes up with multiple frames in various states (docked, external).
Scenario 1(no issue):
The test demo exists on display 1. I drag a docked from to become externalized from display 1 to display 1, everything is fine.
Scenario 2 (issue experienced):
The test demo exists on display 1. If I drag a docked frame to become externalized from display 1 to display 2, the frame becomes invisible. The frame still exists (if you click and drag where the frame was last dropped, it will be found); it can then be dragged back onto the content pane.
Scenario 3 (no issue):
The test demo exists on display 2. I drag a docked frame to become externalized from display 2 to display 1, everything is fine.
Scenario 4 (no issue):
The test demo exists on display 2. I drag a docked frame to become externalized from display 2 to display 2, everything is fine.
Any assistance would be greatly appreciated. Thanks!
The framework just opens a new undecorated JDialog wherever you drop the Dockable, there is nothing special happening. Unfortunately I do not have a second monitor, so I cannot test anything :-/
Hm, if you have one JFrame on display 1, and open an undecorated JDialog (see “JDialog.setUndecorated”) on display 2 (with the frame as parent), does that work?
Doing this pops up the undecorated JDialog on the second screen with text “HIIIIIIIIIIIIIIIIIIIII”, fully visible… of course also unmoveable.
I also ran it without the frame as the parent (just created new JFrame instead) and that had the same result.
Out of curiosity, and fishing in the dark: if you run this program, do you have any different results? And what if you remove the lines with the “comment me out” comment?
import javax.swing.JFrame;
import bibliothek.gui.DockController;
import bibliothek.gui.dock.DefaultDockable;
import bibliothek.gui.dock.ScreenDockStation;
import bibliothek.gui.dock.SplitDockStation;
import bibliothek.gui.dock.station.screen.window.DefaultScreenDockWindowFactory;
import bibliothek.gui.dock.station.screen.window.DefaultScreenDockWindowFactory.Kind;
public class ScreenDockTest {
public static void main(String[] args) {
JFrame frame = new JFrame();
DockController controller = new DockController();
controller.setRootWindow(frame);
DefaultScreenDockWindowFactory factory = new DefaultScreenDockWindowFactory();
// line 1 to test and comment out
factory.setUndecorated(false);
// line 2 to test and comment out
factory.setKind(Kind.FRAME);
// setting the modified factory
controller.getProperties().set(ScreenDockStation.WINDOW_FACTORY, factory);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setBounds(20,20,400,400);
SplitDockStation center = new SplitDockStation();
controller.add(center);
frame.add(center);
ScreenDockStation screen = new ScreenDockStation(controller.getRootWindowProvider());
controller.add(screen);
DefaultDockable dockable = new DefaultDockable("Test, drag me");
center.drop(dockable);
frame.setVisible(true);
screen.setShowing(true);
}
}