Author | Topic: FlowLayout - lets component assume its natural shape |
psethura ranch hand |
posted April 11, 2000 07:55 AM
In API, "A flow layout lets each component assume its natural (preferred) size." But when I try to create a Button of different size, the size is not affected. Frame f = new Frame("h");
|
maha anna bartender |
posted April 11, 2000 03:43 PM
FlowLayour Manager always honours the component's preferred size. There is no doubt in that. It can honour the changed size ,only when the component wants to. The 'Button' Component in Java AWT doesn't change its preferred size when you call setSize(..) on that. Each component reacts to the size related methods differently according to their wish. In fact the Button component's preferred size changes when you call the 'setLabel(..)' method. So the changed preferred size is honoured by the FlowLayout Manager. The foll small prog illustrates what I said. Simillarly other components may react differently for the other methods called on them. regds maha anna
[This message has been edited by maha anna (edited April 11, 2000).]
|
| | |