>
> Don't agree. It's no different than specifying a preferred size on a
> component whose parent container doesn't respect it, for example.
>

> Specifically, a Label needs a width constraint in order to know where to
> break the text. Without a parent that can provide that, it wouldn't know
> where to wrap.
>

Ah, so the problem with my original example is that a vertical BoxPane
thinks that it is infinitely wide until I give it the fill:true style?  No,
it can't be that simple, because even in its absence, BoxPane is able to
center- or right-align its contents within the actual width of its parent.
 Or are those independent?  Is there any reason I wouldn't want to
*always*say fill:true?


There are a couple of ways to handle this. Generally, you'd override
> close(boolean) and execute your login code if the result is true. In this
> case, you wouldn't call the superclass close() method, since you want to
> prevent the dialog from closing. Once the login succeeds, you'll call
> close() again, but call the superclass method to actually close the dialog.
>

Thanks, overriding close is a reasonable approach.  Not quite as simple as
you suggest -- if I just call super.close() when the login succeeds, I seem
to get into an infinite close loop.  I had to add a private flag to set in
the login finished code and test in the close override.

Another way to handle it is to veto the close event, perform the login, and
> then re-close.
>

Okay.  I think that ends up being more verbose, given the verbosity of
listeners, and the fact that I'd still either need that private variable, or
a different one to hang onto the close listener so I can remove it.


> * How do I space the buttons nicely?  . . .
>>
>> Not sure exactly what you're envisioning, but maybe you could use a
> horizontal BoxPane with "horizontalAlignment='center'"? You can use the
> "spacing" style to control how much space is allocated between the buttons.
>

Ah, I somehow missed seeing that in the BoxPaneSkin.  That will do.  It will
take some getting used to, this dichotomy between properties and style
attributes.

Reply via email to