Hello all,
when leaving a docking frame to some other frame (or even leaving the VM) I get no “focus lost” event from the Dockable.
The following example shows two frames: clicking the “docking”-frame I get a “focus gained” event, then clicking the “normal” frame there is no “focus lost” event of the dock.
public static void main(String[] args) {
JFrame frame = new JFrame("docking frame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
CControl control = new CControl(frame);
CContentArea contentarea = control.getContentArea();
frame.add(contentarea);
DefaultSingleCDockable d1 = new DefaultSingleCDockable("d1", "dock");
d1.addFocusListener(new MyFL());
CGrid grid = new CGrid(control);
grid.add(0, 0, 1, 1, d1);
contentarea.deploy(grid);
frame.setBounds(100, 100, 300, 300);
frame.setVisible(true);
JFrame frame2 = new JFrame("normal frame");
frame2.setBounds(500, 100, 300, 300);
frame2.setVisible(true);
}
public static class MyFL implements CFocusListener {
@Override
public void focusGained(CDockable dockable) {
System.out.print("focus gained");
}
@Override
public void focusLost(CDockable dockable) {
System.out.print("focus lost");
}
}
}
Thanks for your help,
Thilo