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.
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.
-
CENTER
- The value indicating components should be centered.
-
LEFT
- The value indicating components should be left
justified (default).
-
RIGHT
- The value indicating components should be right
justified.
-
ColumnLayout()
- Creates a new ColumnLayout manager with a vertical
gap of zero which aligns its components on the left.
-
ColumnLayout(int)
- Creates a new ColumnLayout manager with the specified
vertical gap which aligns its components on the left.
-
addLayoutComponent(String, Component)
- Adds the specified component to the layout.
-
getAlignment()
- Returns the current alignment.
-
layoutContainer(Container)
- Lays out the container in the specified panel.
-
minimumLayoutSize(Container)
- Calculates the minmum size dimensions for the specified
panel given the components in the specified parent container.
-
preferredLayoutSize(Container)
- Calculates the preferred size dimensions for the specified
panel given the components in the specified parent container.
-
removeLayoutComponent(Component)
- Removes the specified component from the layout.
-
setAlignment(int)
- Sets the alignment of this layout manager.
LEFT
public static final int LEFT
- The value indicating components should be left
justified (default).
CENTER
public static final int CENTER
- The value indicating components should be centered.
RIGHT
public static final int RIGHT
- The value indicating components should be right
justified.
ColumnLayout
public ColumnLayout()
- Creates a new ColumnLayout manager with a vertical
gap of zero which aligns its components on the left.
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.
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.
getAlignment
public int getAlignment()
- Returns the current alignment.
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.
removeLayoutComponent
public void removeLayoutComponent(Component comp)
- Removes the specified component from the layout.
- Parameters:
- comp - The component to be removed.
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.
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.
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