Den fre 11 maj 2018 kl 06:32 skrev Patrik Karlström <pat...@trixon.se>:

> Hi,
> How do I listen to Show Only Editor changes and at the same time, get the
> state it's in?
>

Inspired by the source of
https://github.com/apache/incubator-netbeans/blob/master/core.windows/src/org/netbeans/core/windows/EditorOnlyDisplayer.java
I came up with this piece of code for my top component that got me the
result I wanted.

        addHierarchyListener((HierarchyEvent e) -> {
            if (e.getChangedParent() instanceof JLayeredPane) {
                Dimension d = ((JFrame)
WindowManager.getDefault().getMainWindow()).getContentPane().getPreferredSize();
                final boolean showOnlyEditor = 1 == d.height && 1 ==
d.width;
                if (showOnlyEditor) {
                } else {
                }
            }
        });

Reply via email to