Section 16.5. Layout Managers


16.5. Layout Managers

Once you decided on all the graphical objects that you want to pack into your GUI, there is still one major hurdlewhere to place all the objects. This can be one of the more challenging parts of GUI design because so many different screen sizes are available to the end user. How do you make your GUI look good to all (or most) of them?

Beginners often want to fix their components to absolute locationsfor example, by sketching the GUI out on a piece of graph paper and then using those coordinates to fix the location. But with a windowing display, the user can grab a corner of the window and resize it. So, consider that piece of graph paperwhat if it just got stretched to twice the size? Do you want all the controls to just get bigger? Buttons need not grow larger, but it would be nice to have additional space contributed to text areas. Consider a word processor: When you resize its window you only want the text area to expand, not the menus and icons.

Layout managers are meant to address the issues of component placement and sizing. Some are very simple, others are much more complex. All have their advantages and disadvantages. We'll use a few in our example to give you a taste of how they work.



    Java Application Development with Linux
    Java Application Development on Linux
    ISBN: 013143697X
    EAN: 2147483647
    Year: 2004
    Pages: 292

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net