• Post Reply Bookmark Topic Watch Topic
  • New Topic

best layout manager for a container  RSS feed

 
Paul Chamsay
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm just wondering what is the best layout manager to use when you're going to code everything (including layout) manually? It is done through a JApplet, not sure if that matters..

It has LOTS of components and to cut it short, we were only taught how to use GridLayout, FlowLayout, and BorderLayout. If I'm going to code the whole program using these layouts and lots of panels, I'll probably need 30-50 panels in order to finish it.

I've been looking around and I saw this page where Sun recommends GridBagLayout if you're going to code manually. Seems a bit complex but if it will make my task easier, I wouldn't mind learning it. http://java.sun.com/docs/books/tutorial/uiswing/layout/gridbag.html



 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
generally, there's no 'one layoutManager fits all' - often this means nesting layouts (each for a particular strength).
gridbaglayout is very versatile, but, to use it well, it's learning curve is very steep.

30-50 panels? if each is a different screen, I hope your applet supplies coffee
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to second what Michael has told you. Most layouts can be accomplished easier and faster by nesting layouts in multiple containers and avoiding GridBagLayout unless necessary. One thing that intrigues me though, and that I've yet to try is the MiG Layout manager that's not part of core Java, but is available (I believe free) here: MiG Layout Manager
 
Paul Chamsay
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the advice!

@Michael

30-50 panels on one single screen, so no need for coffee (as of now)

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!