![]() Public class BoxLayoutExample4 extends Frame BoxLayout(Container c, int axis): creates a box layout that arranges the components with the given axis.In the case of vertical orientations, the components are always rendered from top to bottom. If the value ComponentOrientation property of the container is also from left to right, then the components are rendered from left to right, and for right to left, the rendering of components is from right to left. For horizontal orientations, we have two cases: left to right, and right to left. If the ComponentOrientation property of the container is horizontal, then components are aligned vertically otherwise, the components are aligned horizontally. public static final int PAGE_AXIS: Alignment of the components is similar to the way text lines are put on a page, which is based on the ComponentOrientation property of the container.If the value ComponentOrientation property of the container is from left to right, then the components are rendered from left to right, and for right to left, the rendering of components is also from right to left. If the ComponentOrientation property of the container is horizontal, then the components are aligned horizontally otherwise, the components are aligned vertically. public static final int LINE_AXIS: Alignment of the components is similar to the way words are aligned in a line, which is based on the ComponentOrientation property of the container.public static final int Y_AXIS: Alignment of the components are vertical from top to bottom.public static final int X_AXIS: Alignment of the components are horizontal from left to right.They are as follows: Note: The BoxLayout class is found in javax.swing package. For this purpose, the BoxLayout class provides four constants. The Java BoxLayout class is used to arrange the components either vertically or horizontally.
0 Comments
Leave a Reply. |