public final class PsSlotLayout
extends java.lang.Object
implements java.awt.LayoutManager, java.io.Serializable
The following example creates a horizontal panel which has three slots. The first slot is occupied with a label and the remaining two slots are filled with a TextField.
Example usage: panel.setLayout(new PsSlotLayout(3)); panel.add("1", new Label("Name")); panel.add("2", new TextField());
Currently, components cannot be removed from this layout manager once they have been added. This may be implemented later.
Constructor and Description |
---|
PsSlotLayout(int numSlots)
Constructor with total number of slots of this container.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Add a new component which occupies the given number of slots.
|
void |
layoutContainer(java.awt.Container parent) |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent) |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent) |
void |
removeLayoutComponent(java.awt.Component comp) |
public PsSlotLayout(int numSlots)
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize
in interface java.awt.LayoutManager
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize
in interface java.awt.LayoutManager
public void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
public void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
"