Layout Manager


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Layout Manager

  1. #1
    Join Date
    Sep 2003
    Posts
    3

    Cool Layout Manager

    What's the better Layout Manager between GridBagLayout and SpringLayout ?
    Lorenzo De Vito

  2. #2
    Join Date
    Mar 2003
    Posts
    834
    There is no "better" layout manager. Pick the most appropriate layout manager for the situation - sometimes flow layout, sometimes grid layout, sometimes gridbag layout....
    ArchAngel.
    O:-)

  3. #3
    Join Date
    Sep 2003
    Posts
    3
    Yes, but SpringLayout is a new layout manager, why think Sun I need a new LM like SpringLayout ?
    Lorenzo De Vito

  4. #4
    Join Date
    Mar 2003
    Posts
    834
    SpringLayout is a new addition, which means that the programmers have had time to draw upon the experience of the previous LayoutManagers. It is therefore likely to benefit from this experience.

    This is true. I've taken a look at it and it looks really nice and flexible.

    However, this does not mean that you'd use it in all cases. If I want the components just to appear one after another, I'm going to use the simplest thing I can - a FlowLayout.

    Try to get *out* of the habit of trying to work out what is the "best" LayoutManager. It's as crazy as trying to work out what is the "best" collection - ArrayList? HashTable? HashMap?

    Try to get *into* the habit of trying to work out what is the *most appropriate* LayoutManager. That's as wise as trying to work out what is the *most appropriate* collection - Sometimes ArrayList, sometimes Hashtable....
    ArchAngel.
    O:-)

  5. #5
    Join Date
    Sep 2003
    Posts
    3
    In my first post I asked about GridBagLayout and SpringLayout, so the only things I would like to know are about differences between these LM, I know others LM and I know datastructures so as I know there are a lot on containers or data access methods but I thing that two LM are only few differences and in these I'm interested...EXCUSE ME FOR MY BAD ENGLISH !!!
    Lorenzo De Vito

  6. #6
    Join Date
    Mar 2003
    Posts
    834
    "In my first post I asked about GridBagLayout and SpringLayout, so the only things I would like to know are about differences between these LM,"

    Yes, but I'm making the point that, in some cases, FlowLayout (the similest LayoutManager) can be "better"

    "I know others LM and I know datastructures so as I know there are a lot on containers or data access methods but I thing that two LM are only few differences and in these I'm interested...EXCUSE ME FOR MY BAD ENGLISH !!!"

    You're missing the point I was trying to make. "better" means very little. "better" for what? In some situations one will be better, in other situations the other will be better.

    Was you question really: "What is the difference between GridBagLayout and SpringLayout?"
    ArchAngel.
    O:-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center