• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Layout Manager  RSS feed

 
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 ?
 
Gold Digger
Posts: 7610
  • 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
Gold Digger
Posts: 7610
  • 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
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!