File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes BorderLayout problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "BorderLayout problem" Watch "BorderLayout problem" New topic
Author

BorderLayout problem

Travis Benning
Ranch Hand

Joined: Jan 24, 2002
Posts: 74
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.


Sun Certified Programmer for Java 2 Platform
Peter Bugla
Greenhorn

Joined: Feb 12, 2002
Posts: 22
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.


Peter Bugla<br />Sun Certified Programmer for Java 2 Platform
Travis Benning
Ranch Hand

Joined: Jan 24, 2002
Posts: 74
Much thanks!
Makes sense now. Of course, my mind doesn't think too well at 3 in the morning.
Travis B.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BorderLayout problem
 
Similar Threads
IBM's exam questions
Unable to display ScrollPane when added to a Panel
gui component sizes
JTextArea scrollbars problem
JScrollpane problem