Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

which is correct?

Ranch Hand
Posts: 55
  • 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.
Ranch Hand
Posts: 1512
  • 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.
Ranch Hand
Posts: 1492
  • 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.
I'm doing laundry! Look how clean this tiny ad is:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!