• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which is correct?

 
Ash sav
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
53. A component that should resize vertically but not horizontally should be placed in a:
a) BorderLayout in the North or South location
b) FlowLayout as the first component
c) BorderLayout in the East or West location
d) BorderLayout in the Center location
e) GridLayout
I think answer is a. If I'm wrong please correct me.
Thanks
Ash
 
Bosun Bello
Ranch Hand
Posts: 1510
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct, the answer is A. A Border layout honors the prefered height of ther North and South components, and forces them to be exactly as wide as the container. Components in the east and west region get to be their preferred width, but their height is constrained.
Bosun
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ash,
You are wrong the correct answer to the question is 'C'.
Here's why! The questions says "should resize vertically".
A) As Bosun correctly stated the North/South locations of BorderLayout won't resize in the vertical direction, only in the horizontal direction.
B) FlowLayout won't resize in any direction because it honors preferred sizes of components.
C) BorderLayout East/West will resize in horizontal direction as the panel gets larger or smaller. This is because the East/West positions are stretched to fit fully between North/South positions.
D) BorderLayout Center will resize in both directions which doesn't answer the question correctly.
E) GridLayout all resizes in both directions with same explanation as D above.
Regards,
Manfred.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic