Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could someone explain why the BorderLayout Manger is only limited to 5 panels?

 
kenny gill
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm trying to solve a short answer on why the manager can only handle 5 panels(without including putting panels inside of panels).

I've tried looking at this link but I couldn't find any information as to why it is limited to 5 panels:

http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/BorderLayout.html
 
Paul Clapham
Sheriff
Pie
Posts: 20959
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's limited to five panels because that's the way it's laid out. One panel in the centre, one at each side, that makes five.
 
Matthew Brown
Bartender
Posts: 4566
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a remarkably flexible layout manager. Full width components at the top and bottom using their preferred height, full (remaining) height components on either side using their preferred width, and the rest.

You can, of course, define a layout behaviour that has more panels. But that would be a different layout. There's nothing stopping people writing one (and many have), but it doesn't make a BorderLayout less useful.

(The only layout manager I've ever written myself that I actually found useful was an "inverse border layout". A centred component of it's own preferred size, and then components filling the spaces round the edges. it came in handy for interfaces with two lists of the same size with some buttons in the middle for transferring between them).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic