CWorkingArea loses focus after maximizing dockable

I’ve set up 2 dockables. The green one on the left is inside a working area, the red one on the right isn’t.
When I set the cursor inside the Textfield of the red dockable and maximize it with Ctrl+M, the Textfield loses its focus. After I use Ctrl+M for the third time, i have to focus the Dockable again.
The red dockable works without problems. The JTextfield keeps its focus and i can repeat Ctrl+M as much as I want.
How can I fix this?


package test.dockingframes;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;

import bibliothek.gui.dock.FlapDockStation;
import bibliothek.gui.dock.common.CControl;
import bibliothek.gui.dock.common.CLocation;
import bibliothek.gui.dock.common.CWorkingArea;
import bibliothek.gui.dock.common.DefaultSingleCDockable;
import bibliothek.gui.dock.common.SingleCDockable;
import bibliothek.gui.dock.common.theme.ThemeMap;

public class DFTest {

    public static void main(String[] args) {
        // frame
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(800, 600);
        frame.setLocationRelativeTo(null);

        // control
        CControl dfControl = new CControl(frame);
        JPanel p = dfControl.getContentArea();
        frame.getContentPane().add(p);

        // working area
        CWorkingArea workArea = dfControl.createWorkingArea("workArea");
        dfControl.putProperty(FlapDockStation.MINIMUM_SIZE, new Dimension(2, 2));
        workArea.setLocation(CLocation.base().normalRectangle(0, 0, 1, 1));
        workArea.setVisible(true);

        // theme
        ThemeMap dfThemes = dfControl.getThemes();
        dfThemes.select(ThemeMap.KEY_ECLIPSE_THEME);

        { // red area

            JPanel panel = new JPanel();
            panel.setBackground(Color.red);
            JTextField field = new JTextField();
            field.setBounds(100, 100, 50, 25);
            field.setText("abcd");
            panel.add(field);

            SingleCDockable dock = new DefaultSingleCDockable("right", "right", panel);
            dock.setLocation(CLocation.base().normalEast(0.3));
            dfControl.add(dock);
            dock.setVisible(true);
        }

        { // green Working Area

            JPanel panel = new JPanel();
            panel.setBackground(Color.green);
            JTextField field = new JTextField();
            field.setBounds(100, 100, 50, 25);
            field.setText("abcd");
            panel.add(field);

            final SingleCDockable dock = new DefaultSingleCDockable("left", "left", panel);
            dock.setLocation(CLocation.working(workArea).rectangle(0, 0, 1, 1));
            workArea.add(dock);
            dock.setVisible(true);
        }

        frame.setVisible(true);
    }

}


When I set the cursor inside the Textfield of the red dockable and maximize it with Ctrl+M, the Textfield loses its focus.

I meant the Textfield in the green area.

That’s a bug of the framework. I’ll fix it as soon as possible.

Ah ok. thank you.