Knute Johnson <nospam@rabbitbrush.frazmtn.com> wrote:
I'm sorry, it's just not clear to me what you are trying to do. Maybe
an SSCCE would help?
I don't see, how an SSCCE would help in this particular situation.
SSCCE's are, if I see some behaviour that I don't want and cannot
explain.
In my case I *want* some particular behaviour, and if I could code
that behaviour into an SSCCE, I wouldn't need to ask the question
in the first place. Since I do not yet know how to code that
behaviour, I'm still bound to describe it, and I can't see how
anyone would understand my description better, just because they
now have a window with a particular layout that behaves some
other way.
I'll try it now some other way. Giving names to things often
helps, afterall.
That's the layout:
JSplitPane jsp1=new JSplitPane()
JSplitPane jsp2=new JSplitPane()
JSplitPane jsp3=new JSplitPane()
jsp1.add(jsp2); jsp1.add(jsp3);
jsp2.add(comp1); jsp2.add(comp2);
jsp3.add(comp3); jsp3.add(comp4);
Each of the components comp1-comp4 can be assumed to have
reasonable (and in my case non-zero) minimum and preferred
sizes.
What I'm after in this thread is: if the user uses those
little arrow-buttons in jsp3's splitter to minimize(hide) comp4,
then (rather than comp3 alone growing for the freed space) I'd
like all comp1,comp2 and comp3 to grow equally. For this, the
jsp3 would have to inform jsp1 of a reduced preferred size
(which of course isn't standard behaviour of splitpanes), and
let jsp1 rearrange the space among it's child splitpanes, so
in the end comp1, comp2 and comp3 are equal-sized and together
consume the same screenspace as did comp1-comp4 before the user's
action.
Maybe I'm missing something obvious, but I don't see where
and how I could add a callback to be informed of user clicking
those minimize-buttons in the splitter.
OK, I think I understand what you want to do now. The only way I can
events. Adjust the middle divider according to the percentage of window
covering the hidden component. It's a tricky one for sure.