• 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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Layout Manager

 
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A frame uses BorderLayout Management and has components added to all the regions. One resizing the Frame Some space becomes available. The space is alloted to the regions, in which Order of preference?

1.North , South, West, East and then Center.
2.North , West, South, Center and then Center.
3.Center, East, West, South and then North.
4.West, Center, South, North and then East.
Is the Answer 3 or 1
Any idea ?
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
North and South have width priority which means that first the width of the components placed NORTH and SOUTH will be increased (or decreased). Then EAST and WEST have their height increased (or decreased) and finally CENTER takes the remaining space.
So I would choose answer 1
Anyone ??
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Valentin Crettaz
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just to confirm that 1 is the correct answer here is the code of the method layoutContainer in java/awt/BorderLayout.java

Clearly NORTH and SOUTH have priority over EAST and WEST which in turn have priority over CENTER
HIH

------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Look ma! I'm selling my stuff!
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic