Forums Register Login

BorderLayout problem

+Pie Number of slices to send: Send
Hi,
I hit this question on the Proddar Mock Exam:
Q36) Which one of the following always ignores the components's preferred size.
a) FlowLayout
b) GridLayout
c) BorderLayout
Correct answer is b)
Wouldn't BorderLayout also be correct?
I thought since if someting get assigned to BorderLayout, it's "preferred size" is not honored. BorderLayout has it's own limitations.
I might be making myself look stupid on this, but I just got to know.
Thanks,
Travis B.
+Pie Number of slices to send: Send
BorderLayout honors some of the preferred width and height values:
The Components in North and South keep their preferred height (and get the width of the container). The Components at West and East keep their preferred width (and get the height of the container minus the height of the North and South Components if present). The Component in Center is stretched to fill the remaining space.
+Pie Number of slices to send: Send
Much thanks!
Makes sense now. Of course, my mind doesn't think too well at 3 in the morning.
Travis B.
Opportunity is missed by most people because it is dressed in overalls and looks like work - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 894 times.
Similar Threads
IBM's exam questions
JTextArea scrollbars problem
gui component sizes
JScrollpane problem
Unable to display ScrollPane when added to a Panel
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:26:25.