From: markspace on
Andreas Leitgeb wrote:
> That last component isn't really to be removed/added dynamically, but
> only invisibilized by its slider sticking at the bottom of that particular
> JSplitPane, so the user can "restore" it using the slider.
>


Now I'm confused. Is this desired behavior, or not? If you can make an
SSCCE, I think that would help a lot.
From: Knute Johnson on
Andreas Leitgeb wrote:
> Knute Johnson <nospam(a)rabbitbrush.frazmtn.com> wrote:
>> Andreas Leitgeb wrote:
>>> Now, "they" want a special behaviour: if the bottom-most component
>>> is hidden (with slider's arrow-buttons on windows), then the other
>>> three components should all grow to fill the available screen-estate,
>>> and if the last one is made visible again, then all the other ones
>>> should shrink equally a little to make room for the last one.
>> Do they want the sliders between to move?
>
> Yes, of course the sliders all have to move for the components to change
> size as requested.
>
> E.g. if normally each of the 4 component has an extent of 300 pixels
> in the relevant direction, and then the last one is hidden, then the
> remaining ones should grow to 400 pixels to compensate for the space
> left behind by the last one, and if the user clicks on the slider-
> button to make that last one visible again, then all the components
> should settle at 300 pixels again, unless the user sets other sizes.
>
> Up to a few questions (which I'll ask in a new thread), I think I mostly
> understand the mechanics of a single JSplitPane. It's the cascading of
> multiple JSplitPanes that still troubles me.
>

I'm sorry, it's just not clear to me what you are trying to do. Maybe
an SSCCE would help?

--

Knute Johnson
email s/nospam/knute2009/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
From: Andreas Leitgeb on
Knute Johnson <nospam(a)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.

From: Patricia Shanahan on
Andreas Leitgeb wrote:
> Knute Johnson <nospam(a)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.

You could write an SSCCE that exhibits the behavior you don't like, and
explain what is wrong in terms of what that application does. That would
give people a test case for experiments.

Patricia
From: RedGrittyBrick on
Andreas Leitgeb wrote:
> I've got difficulties with JSplitPane:
> Some dialog consist of four parts (vertically), with sliders between each.
> That was created by a colleague with netbean's form-editor, and works almost
> ok. There is one master-JSplitPane, and two inner JSplitPanes and inside
> that are the actual components.
>
> Now, "they" want a special behaviour: if the bottom-most component
> is hidden (with slider's arrow-buttons on windows), then the other
> three components should all grow to fill the available screen-estate,
> and if the last one is made visible again, then all the other ones
> should shrink equally a little to make room for the last one.
>
> I'm a bit at loss. It seems to do a lot already on closing/reopening
> that last part. Things that I can only assume is implemented in the
> JSplitPane (as I didn't implement it myself; perhaps that goes auto-
> magically based on Components' preferred- and minimum sizes), but it
> doesn't propagate that extra space to the upper sibling in the master
> JSplitPane. I.e.: only the upper component of the lower inner JSplitPane
> gets all the extra space.

Maybe this will help?

http://www.java2s.com/Tutorial/Java/0240__Swing/DistributingSpaceWhenaJSplitPaneContainerIsResized.htm


--
RGB
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4
Prev: Adding int to a float
Next: how to enlarger Java heap size?