> I have been successfully using jgoodies DefaultFormBuilder to
> dynamically build my forms with TextFields, FormattedFields, DateFields
[quoted text clipped - 7 lines]
> So I create the 2 components, placed them on a JPanel and fixed the
> size 130,23 of the JPanel.
I recommend to not set a fixed size;
and if you set a fixed size, do not specificy
in in pixel. If the hardware screen resolution
changes, the pixel size of (130, 23) may be
perceived as larger or smaller. Today's popular LCDs
have a hardware resolution between 80dpi and 144dpi.
So the perceived width could shrink to the half.
> However when I create the component it is resized to a height of 1 for
> some unknown reason.
>
> DefaultFormBuilder builder = LayoutUtility.getDefaultBuilder(2);
> builder.append(label, getCustomControl());
The DefaultFormBuilder is intended for (larger)
default forms. A sub-panel with two components
with a fixed size is not a default form. And so,
I'd not use the DefaultFormBuilder. In such a
simple case, you may want to use the simpler
PanelBuilder (often a good choice) or use no
builder at all.
I suggest that you browse the Forms "Tips & Tricks"
that you can find from the Forms' README.html.
> Anyone familiar with this perchance?
You may consider posting a runnable example
in the Forms user mailing list (see the README.html).
In that list, a lot of people can assist you.
-Karsten Lentzsch
timasmith@hotmail.com - 28 Feb 2006 00:44 GMT
Thanks Karsten for your time.
Turns out I was foolish and was using panel.setSize(...) instead of
panel.setPreferredSize(...) - only the latter works
So placing 2 controls on a panel to make a custom control works just
fine with the DefaultFormBuilder - I will read up on the tips and
tricks for preferred methods.
I must say I *love* your jgoodies toolset.
thanks
Tim