All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.awt.ColumnLayout

java.lang.Object
   |
   +----com.sun.wizards.awt.ColumnLayout

public class ColumnLayout
extends Object
implements LayoutManager, Serializable
The ColumnLayout creates a single column of components that are added to its parent container. Alignment can be specified as left justified, centered, or right justified.

Graphic of layout for four buttons

Here is the code for this applet:


 import java.applet.Applet;
 import java.awt.*;
 import com.sun.wizards.awt.*;
 public class Test extends Applet
 {
   public void init()
     {
       setLayout(new ColumnLayout());
       add(new Button("Button 1"));
       add(new Button("Button 2"));
       add(new Button("Button 3"));
       add(new Button("Button 4"));
     }
 }
 

A ColumnLayout lets each component assume its natural (preferred) size.


Variable Index

 o CENTER
The value indicating components should be centered.
 o LEFT
The value indicating components should be left justified (default).
 o RIGHT
The value indicating components should be right justified.

Constructor Index

 o ColumnLayout()
Creates a new ColumnLayout manager with a vertical gap of zero which aligns its components on the left.
 o ColumnLayout(int)
Creates a new ColumnLayout manager with the specified vertical gap which aligns its components on the left.

Method Index

 o addLayoutComponent(String, Component)
Adds the specified component to the layout.
 o getAlignment()
Returns the current alignment.
 o layoutContainer(Container)
Lays out the container in the specified panel.
 o minimumLayoutSize(Container)
Calculates the minmum size dimensions for the specified panel given the components in the specified parent container.
 o preferredLayoutSize(Container)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.
 o removeLayoutComponent(Component)
Removes the specified component from the layout.
 o setAlignment(int)
Sets the alignment of this layout manager.

Variables

 o LEFT
 public static final int LEFT
The value indicating components should be left justified (default).

 o CENTER
 public static final int CENTER
The value indicating components should be centered.

 o RIGHT
 public static final int RIGHT
The value indicating components should be right justified.

Constructors

 o ColumnLayout
 public ColumnLayout()
Creates a new ColumnLayout manager with a vertical gap of zero which aligns its components on the left.

 o ColumnLayout
 public ColumnLayout(int vgap)
Creates a new ColumnLayout manager with the specified vertical gap which aligns its components on the left.

Parameters:
vgap - The desired vertical gap between components.

Methods

 o setAlignment
 public void setAlignment(int alignment)
Sets the alignment of this layout manager. Valid values are: LEFT, CENTER, and RIGHT.

Parameters:
alignment - The desired horizontal alignment.
 o getAlignment
 public int getAlignment()
Returns the current alignment.

 o addLayoutComponent
 public void addLayoutComponent(String constraint,
                                Component comp)
Adds the specified component to the layout.

Parameters:
constraint - The constraint is ignored.
comp - The component to be added.
 o removeLayoutComponent
 public void removeLayoutComponent(Component comp)
Removes the specified component from the layout.

Parameters:
comp - The component to be removed.
 o minimumLayoutSize
 public Dimension minimumLayoutSize(Container target)
Calculates the minmum size dimensions for the specified panel given the components in the specified parent container.

Parameters:
target - The component to be laid out.
 o preferredLayoutSize
 public Dimension preferredLayoutSize(Container target)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container.

Parameters:
target - The component to be laid out.
 o layoutContainer
 public void layoutContainer(Container target)
Lays out the container in the specified panel.

Parameters:
target - The component which needs to be laid out.

All Packages  Class Hierarchy  This Package  Previous  Next  Index