|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.clearthought.layout.ComponentArranger
public final class ComponentArranger
This builder creates a TableLayout based on an arrangement of components within a one-dimensional array. The array given by the user should contain a container at index 0, followed by a double or int for each column, followed by elements for each row of the layout. Each row should begin with a double or int for the row height, followed by zero or more components that occupy cells in that row. Components can span cells by being repeated in the array. Cells can be skipped by using nulls. Rows can be ended by indicating the next row start with a double or int. Below is an example that demonstrates all of these principles.
ComponentArranger.arrange(5, 5, new Object [] {contentPane, TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED, labelSource, textboxSource, buttonBrowseSource, TableLayout.PREFERRED, labelDestination, textboxDestination, buttonBrowseDestination, TableLayout.FILL, null, scrollPane, scrollPane, TableLayout.PREFERRED, labelHi, scrollPane, scrollPane, 5, TableLayout.PREFERRED, panelButton, panelButton, panelButton});
Method Summary | |
---|---|
static void |
alignComponent(TableLayout layout,
java.awt.Component component,
int hAlign,
int vAlign)
Aligns the given component in the given layout. |
static TableLayout |
arrange(int hGap,
int vGap,
java.lang.Object[] array)
Creates a TableLayout using the container, components, and row/column sizes in the given array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void alignComponent(TableLayout layout, java.awt.Component component, int hAlign, int vAlign)
layout
- Layout being altered.component
- Component whose alignment is being set.hAlign
- New horizontal alignment.vAlign
- New vertical alignment.public static TableLayout arrange(int hGap, int vGap, java.lang.Object[] array)
hGap
- Horizontal gap between columns.vGap
- Vertical gap between rows.array
- See examples in ComponentArranger class JavaDoc for details on how to construct this array.
ComponentArranger
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |