< prev index next >
src/java.desktop/share/classes/javax/swing/BoxLayout.java
Print this page
*** 52,83 ****
* of which contains 3 components arranged vertically.
*
* <p> The BoxLayout manager is constructed with an axis parameter that
* specifies the type of layout that will be done. There are four choices:
*
! * <blockquote><b><tt>X_AXIS</tt></b> - Components are laid out horizontally
* from left to right.</blockquote>
*
! * <blockquote><b><tt>Y_AXIS</tt></b> - Components are laid out vertically
* from top to bottom.</blockquote>
*
! * <blockquote><b><tt>LINE_AXIS</tt></b> - Components are laid out the way
* words are laid out in a line, based on the container's
! * <tt>ComponentOrientation</tt> property. If the container's
! * <tt>ComponentOrientation</tt> is horizontal then components are laid out
* horizontally, otherwise they are laid out vertically. For horizontal
! * orientations, if the container's <tt>ComponentOrientation</tt> is left to
* right then components are laid out left to right, otherwise they are laid
* out right to left. For vertical orientations components are always laid out
* from top to bottom.</blockquote>
*
! * <blockquote><b><tt>PAGE_AXIS</tt></b> - Components are laid out the way
* text lines are laid out on a page, based on the container's
! * <tt>ComponentOrientation</tt> property. If the container's
! * <tt>ComponentOrientation</tt> is horizontal then components are laid out
* vertically, otherwise they are laid out horizontally. For horizontal
! * orientations, if the container's <tt>ComponentOrientation</tt> is left to
* right then components are laid out left to right, otherwise they are laid
* out right to left. For vertical orientations components are always
* laid out from top to bottom.</blockquote>
* <p>
* For all directions, components are arranged in the same order as they were
--- 52,83 ----
* of which contains 3 components arranged vertically.
*
* <p> The BoxLayout manager is constructed with an axis parameter that
* specifies the type of layout that will be done. There are four choices:
*
! * <blockquote><b>{@code X_AXIS}</b> - Components are laid out horizontally
* from left to right.</blockquote>
*
! * <blockquote><b>{@code Y_AXIS}</b> - Components are laid out vertically
* from top to bottom.</blockquote>
*
! * <blockquote><b>{@code LINE_AXIS}</b> - Components are laid out the way
* words are laid out in a line, based on the container's
! * {@code ComponentOrientation} property. If the container's
! * {@code ComponentOrientation} is horizontal then components are laid out
* horizontally, otherwise they are laid out vertically. For horizontal
! * orientations, if the container's {@code ComponentOrientation} is left to
* right then components are laid out left to right, otherwise they are laid
* out right to left. For vertical orientations components are always laid out
* from top to bottom.</blockquote>
*
! * <blockquote><b>{@code PAGE_AXIS}</b> - Components are laid out the way
* text lines are laid out on a page, based on the container's
! * {@code ComponentOrientation} property. If the container's
! * {@code ComponentOrientation} is horizontal then components are laid out
* vertically, otherwise they are laid out horizontally. For horizontal
! * orientations, if the container's {@code ComponentOrientation} is left to
* right then components are laid out left to right, otherwise they are laid
* out right to left. For vertical orientations components are always
* laid out from top to bottom.</blockquote>
* <p>
* For all directions, components are arranged in the same order as they were
*** 100,113 ****
* <p>
* Similarly, for a vertical layout,
* BoxLayout attempts to make all components in the column
* as wide as the widest component.
* If that fails, it aligns them horizontally
! * according to their X alignments. For <code>PAGE_AXIS</code> layout,
* horizontal alignment is done based on the leading edge of the component.
* In other words, an X alignment value of 0.0 means the left edge of a
! * component if the container's <code>ComponentOrientation</code> is left to
* right and it means the right edge of the component otherwise.
* <p>
* Instead of using BoxLayout directly, many programs use the Box class.
* The Box class is a lightweight container that uses a BoxLayout.
* It also provides handy methods to help you use BoxLayout well.
--- 100,113 ----
* <p>
* Similarly, for a vertical layout,
* BoxLayout attempts to make all components in the column
* as wide as the widest component.
* If that fails, it aligns them horizontally
! * according to their X alignments. For {@code PAGE_AXIS} layout,
* horizontal alignment is done based on the leading edge of the component.
* In other words, an X alignment value of 0.0 means the left edge of a
! * component if the container's {@code ComponentOrientation} is left to
* right and it means the right edge of the component otherwise.
* <p>
* Instead of using BoxLayout directly, many programs use the Box class.
* The Box class is a lightweight container that uses a BoxLayout.
* It also provides handy methods to help you use BoxLayout well.
*** 123,133 ****
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @see Box
* @see java.awt.ComponentOrientation
* @see JComponent#getAlignmentX
--- 123,133 ----
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the {@code java.beans} package.
* Please see {@link java.beans.XMLEncoder}.
*
* @see Box
* @see java.awt.ComponentOrientation
* @see JComponent#getAlignmentX
*** 150,182 ****
public static final int Y_AXIS = 1;
/**
* Specifies that components should be laid out in the direction of
* a line of text as determined by the target container's
! * <code>ComponentOrientation</code> property.
*/
public static final int LINE_AXIS = 2;
/**
* Specifies that components should be laid out in the direction that
* lines flow across a page as determined by the target container's
! * <code>ComponentOrientation</code> property.
*/
public static final int PAGE_AXIS = 3;
/**
* Creates a layout manager that will lay out components along the
* given axis.
*
* @param target the container that needs to be laid out
* @param axis the axis to lay out components along. Can be one of:
! * <code>BoxLayout.X_AXIS</code>,
! * <code>BoxLayout.Y_AXIS</code>,
! * <code>BoxLayout.LINE_AXIS</code> or
! * <code>BoxLayout.PAGE_AXIS</code>
*
! * @exception AWTError if the value of <code>axis</code> is invalid
*/
@ConstructorProperties({"target", "axis"})
public BoxLayout(Container target, int axis) {
if (axis != X_AXIS && axis != Y_AXIS &&
axis != LINE_AXIS && axis != PAGE_AXIS) {
--- 150,180 ----
public static final int Y_AXIS = 1;
/**
* Specifies that components should be laid out in the direction of
* a line of text as determined by the target container's
! * {@code ComponentOrientation} property.
*/
public static final int LINE_AXIS = 2;
/**
* Specifies that components should be laid out in the direction that
* lines flow across a page as determined by the target container's
! * {@code ComponentOrientation} property.
*/
public static final int PAGE_AXIS = 3;
/**
* Creates a layout manager that will lay out components along the
* given axis.
*
* @param target the container that needs to be laid out
* @param axis the axis to lay out components along. Can be one of:
! * {@code BoxLayout.X_AXIS, BoxLayout.Y_AXIS,
! * BoxLayout.LINE_AXIS} or {@code BoxLayout.PAGE_AXIS}
*
! * @exception AWTError if the value of {@code axis} is invalid
*/
@ConstructorProperties({"target", "axis"})
public BoxLayout(Container target, int axis) {
if (axis != X_AXIS && axis != Y_AXIS &&
axis != LINE_AXIS && axis != PAGE_AXIS) {
*** 190,203 ****
* Constructs a BoxLayout that
* produces debugging messages.
*
* @param target the container that needs to be laid out
* @param axis the axis to lay out components along. Can be one of:
! * <code>BoxLayout.X_AXIS</code>,
! * <code>BoxLayout.Y_AXIS</code>,
! * <code>BoxLayout.LINE_AXIS</code> or
! * <code>BoxLayout.PAGE_AXIS</code>
*
* @param dbg the stream to which debugging messages should be sent,
* null if none
*/
BoxLayout(Container target, int axis, PrintStream dbg) {
--- 188,199 ----
* Constructs a BoxLayout that
* produces debugging messages.
*
* @param target the container that needs to be laid out
* @param axis the axis to lay out components along. Can be one of:
! * {@code BoxLayout.X_AXIS, BoxLayout.Y_AXIS,
! * BoxLayout.LINE_AXIS} or {@code BoxLayout.PAGE_AXIS}
*
* @param dbg the stream to which debugging messages should be sent,
* null if none
*/
BoxLayout(Container target, int axis, PrintStream dbg) {
*** 217,230 ****
}
/**
* Returns the axis that was used to lay out components.
* Returns one of:
! * <code>BoxLayout.X_AXIS</code>,
! * <code>BoxLayout.Y_AXIS</code>,
! * <code>BoxLayout.LINE_AXIS</code> or
! * <code>BoxLayout.PAGE_AXIS</code>
*
* @return the axis that was used to lay out components
*
* @since 1.6
*/
--- 213,224 ----
}
/**
* Returns the axis that was used to lay out components.
* Returns one of:
! * {@code BoxLayout.X_AXIS, BoxLayout.Y_AXIS,
! * BoxLayout.LINE_AXIS} or {@code BoxLayout.PAGE_AXIS}
*
* @return the axis that was used to lay out components
*
* @since 1.6
*/
< prev index next >