One major problem for the layout manager is to obtain the best sizes for a control. java-awt and my first attempt here, too, define that the control has to delivers the minimum, preferred and maximum sizes, but this only relocates the problem to the controls themself.
Some controls are quite straightforward in calculating their sizes: These are: Button, Label and TextBox, giving their minimum and preferred sizes as (both) the size of the text they contain plus an adequate amount of space for the border.
But how about other components? Say, a treeview? How can it (simply) calculate the size it needs?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One major problem for the layout manager is to obtain the best sizes for a control. java-awt and my first attempt here, too, define that the control has to delivers the minimum, preferred and maximum sizes, but this only relocates the problem to the controls themself.
Some controls are quite straightforward in calculating their sizes: These are: Button, Label and TextBox, giving their minimum and preferred sizes as (both) the size of the text they contain plus an adequate amount of space for the border.
But how about other components? Say, a treeview? How can it (simply) calculate the size it needs?