Swing Layouts
Explain layout managers?
Layout managers are used for arranging GUI components in windows. The standard layout managers are:
• FlowLayout: Default layout for Applet and Panel. Lays out components from left to right, starting new rows if necessary.
• BorderLayout: Default layout for Frame and Dialog. Lays out components in north, south, east, west and
center. All extra space is placed on the center.
• CardLayout: stack of same size components arranged inside each other. Only one is visible at any time. Used in TABs.
• GridLayout: Makes a bunch of components equal in size and displays them in the requested number of rows
and columns.
• GridBagLayout: Most complicated but the most flexible. It aligns components by placing them within a grid of cells, allowing some components to span more than one cell. The rows in the grid aren’t necessarily all the same height, similarly, grid columns can have different widths as well.
BoxLayout: is a full-featured version of FlowLayout. It stacks the components on top of each other or places  them in a row.
No comments yet.
Leave a comment
-
Recent
-
Links
-
Archives
- December 2009 (2)
- August 2009 (1)
- July 2009 (2)
- April 2009 (4)
- March 2009 (6)
- February 2009 (5)
- January 2009 (4)
- December 2008 (3)
- November 2008 (35)
- October 2008 (20)
-
Categories
-
RSS
Entries RSS
Comments RSS