Tutorial: BorderLayout Manager


by
Ronald S. Holland
Total Application Works
RonHolland@sumtotalz.com






To visit my site

[HOME] [Consulting] [Design] [Maintenance] [Project] [Testing] [Training] [Turnkey] [Java] [C++] [SQL] [HTML] [JavaScript ]



To contact us

© 2002 - 2009 All Rights Reserved Total Application Works


  • Tell a friend about this site (copy and paste the following link or send this page to a friend.)
  • <html>
    <title>Example of a link </title>
    <body>
    <table border>
    <a href="http://sumtotalz.com/TotalAppsWorks/LayoutManager/BorderLayout/BorderLayout_Intro.html">An Introduction to the BorderLayout Manager </a>
    </table>
    </body>
    </html>
  1. Java Table of contents
  2. 2nd Java Cup
  3. Pie Chart I
  4. Pie/Bar Chart IB
  5. Pie/Bar Chart II
  6. Pie/Bar Chart III
  7. A Basic Calculator
  8. Linked Lists
  9. Linked List II
  10. Linked List III
  11. Linked List IV
  12. Hardware Store I
  13. Hardware Store II
  14. Hardware Store III
  15. Client/Server
  16. Client/Server II
  17. Client/Server III
  18. Client/Server IV
  19. Multithreaded Client/Server
  20. Multithreaded Client/Server II
  21. Multithreaded Client/Server III
  22. Basic Calculator II
  23. Basic Calculator III
  • Introduction
  • BorderLayout Manager code/source/resources

    Introduction

    The purpose of this tutorial is to introduce you to the concept of the BorderLayout manager. The BorderLayout manager implements the LayoutManager Interface. The BorderLayout manager is the default layout manager for JFrames. The BorderLayout is able to place components in five areas: "North", "South", "East", "West" and "Center". When you enlarge a container the center area grabs as much of the new space as possible. Each area displays one component (which could be another container such as a JPanel). If nothing is added to an outer area, meaning that they take up no space, then other areas with components will expand to fill the void. BorderLayout is good for maintaining a row of buttons in one of the areas near the edges. BorderLayout has two constructors:

    • BorderLayout() - Constructs a new border layout with no gaps between components.
    • BorderLayout(int hgap, int vgap) - Constructs a border layout with the specified gaps between components.


     
    Class BorderLayout
    
    java.lang.Object
      java.awt.BorderLayout
     
    Figure 1: Class BorderLayout


    Figure 2: BorderLayout example


    BorderLayout Manager code/source/resources

    1. A Basic Calculator I - demonstrates how the BorderLayout Manager arranges buttons for a calculator pad.
    2. A Basic Calculator II - demonstrates how the BorderLayout Manager arranges buttons for a calculator pad.
    3. A Basic Calculator III - demonstrates how the BorderLayout Manager arranges buttons for a calculator pad.
    4. Uses multiple layout manager to initialize and sort an array.
    5. This example demonstrates how to use various layout managers - Various Layout Managers Demo








  • [HOME] [Consulting] [Design] [Maintenance] [Project] [Testing] [Training] [Turnkey] [Java] [C++] [SQL] [HTML] [JavaScript ]

    © 2002 - 2009 All Rights Reserved Total Application Works