Re: custom Swing component
- From: Roedy Green <my_email_is_posted_on_my_website@xxxxxxxxxxxxxx>
- Date: Thu, 29 Sep 2005 05:03:01 GMT
On 28 Sep 2005 00:40:44 -0700, "Chanchal" <chanchal.jacob@xxxxxxxxx>
wrote or quoted :
>Thank you for your helpful reply. but is there any way to actually set
>the size of the text field when the panel containing it is resized??
Yes, many different ways. The proper way is to use a layout that
calculates a size. If none of the layouts will compute the right size
you write one that does. See http://mindprod.com/jgloss/layout.html
It is possible, though strongly frowned on, to setLayout( null );
to turn off the layout manager. Then you are are on your own to size
and place all the components with setSize, setLocation or setBounds.
One time I consider using a null layout acceptable is for extremely
simple layouts that very definitely have a fixed size where you need a
small footprint and high speed, such as my CurrCon applet. See
http://mindprod.com/applets/currcon.html
The other time is when you have an extremely complex layout where
everything is packed in like a Swiss watch and you want to rigidly
control the layout to the last pixel. Even then, you are better to use
a LayoutManager that gives fine absolute positioning control rather
than a null layout manager.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
.
- Follow-Ups:
- Re: custom Swing component
- From: Chanchal
- Re: custom Swing component
- References:
- custom Swing component
- From: Chanchal
- Re: custom Swing component
- From: Roedy Green
- Re: custom Swing component
- From: Chanchal
- custom Swing component
- Prev by Date: Re: Can not enter ^
- Next by Date: Re: easy drag drop for java UI possible?[OT]
- Previous by thread: Re: custom Swing component
- Next by thread: Re: custom Swing component
- Index(es):
Relevant Pages
|
|