|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--dog.gui.BoxLayout
A box layout is used to lay out components in a container. It will arranges the components either horizontally or vertically. In a horizontal box layout, each component is expanded to the height of the container and the components are laid out from left to right. In a vertical box layout, each component is expanded to the width of the container and the components are laid out from top to bottom.
| Field Summary | |
static int |
HORIZONTAL
The horizontal orientation. |
protected int |
orientation
The orientation of the layout. |
static int |
VERTICAL
The vertical orientation. |
| Constructor Summary | |
BoxLayout()
Constructs a new vertical box layout with the default 5-unit horizontal and vertical gap. |
|
BoxLayout(int orientation)
Constructs a new box layout with the specified orientation and the default 5-unit horizontal and vertical gap. |
|
BoxLayout(int orientation,
int hgap,
int vgap)
Constructs a new layout with the specified orientation and gap values. |
|
| Method Summary | |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Adds the specified component to the layout. |
int |
getHgap()
Returns the horizontal gap between components. |
int |
getOrientation()
Returns the orientation of this layout (HORIZONTAL or VERTICAL). |
int |
getVgap()
Returns the vertical gap between components. |
void |
layoutContainer(java.awt.Container target)
Lays out the container. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions needed to layout the components contained in the specified target container. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout given the components in the specified target container. |
void |
removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout. |
void |
setHgap(int hgap)
Sets the horizontal gap between components. |
void |
setOrientation(int orientation)
Sets the orientation value for this layout. |
void |
setVgap(int vgap)
Sets the vertical gap between components. |
java.lang.String |
toString()
Returns the string representation of this layout's values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int HORIZONTAL
public static final int VERTICAL
protected int orientation
| Constructor Detail |
public BoxLayout()
public BoxLayout(int orientation)
orientation - the orientation of the layout
public BoxLayout(int orientation,
int hgap,
int vgap)
orientation - the orientation of the layouthgap - the horizontal gap variablevgap - the vertical gap variable| Method Detail |
public int getOrientation()
public void setOrientation(int orientation)
orientation - the orientation value (HORIZONTAL or VERTICAL).public int getHgap()
public void setHgap(int hgap)
hgap - the horizontal gap between componentspublic int getVgap()
public void setVgap(int vgap)
vgap - the vertical gap between components
public void addLayoutComponent(java.lang.String name,
java.awt.Component comp)
addLayoutComponent in interface java.awt.LayoutManagername - the name of the componentcomp - the the component to be addedpublic void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent in interface java.awt.LayoutManagercomp - the component to removepublic java.awt.Dimension preferredLayoutSize(java.awt.Container target)
preferredLayoutSize in interface java.awt.LayoutManagertarget - the component which needs to be laid outContainer,
minimumLayoutSize(java.awt.Container)public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
minimumLayoutSize in interface java.awt.LayoutManagertarget - the component which needs to be laid outpreferredLayoutSize(java.awt.Container)public void layoutContainer(java.awt.Container target)
layoutContainer in interface java.awt.LayoutManagertarget - the specified component being laid out.Containerpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||