This is a feature of JBuilder Professional and Enterprise.
XYLayout
is a JBuilder custom layout manager. XYLayout
puts components in a container at specific x,y coordinates relative to the upper left corner of the container. Regardless of the type of display, the container will always retain the relative x,y positions of components.
XYLayout
, the components do not reposition or resize.
Example
You'll discover that XYLayout
is very convenient to use for protoyping your design work. When you design more complicated user interfaces with multiple, nested panels, XYLayout
can be used for the initial layout of the panels and components, after which you can choose from one of the standard layouts for the final design.
XYLayout
in your final design.
You can use the visual design tools to specify the container's size and its components' x,y coordinates.
XYLayout
container, select the XYLayout
object in the component tree and enter the pixel dimension for the height
and width
properties in the Inspector. This sets the size of the XYLayout
container.
XYLayout
container, do one of the following:
constraints
property edit field and enter coordinates for that component.
XYLayout
. Alignment does not work for other layouts. See Using layout managers.
With alignment operations, you can make a set of components the same width, height, left alignment, and so on, so that they look cleanly organized.
To align components,
Select this | To do this |
---|---|
Move To First | Move the selected component to the top of the Z-order. |
Move To Last | Move the selected component to the bottom of the Z-order. |
Align Left | Line up the left edges of the components with the left edge of the first selected component. |
Align Center | Horizontally line up the centers of the components with the center of the first selected component. |
Align Right | Line up the right edges of the components with the right edge of the first selected component. |
Align Top | Line up the top edges of the components with the top edge of the first selected component. |
Align Middle | Vertically line up the centers of the components with the middle of the first selected component. |
Align Bottom | Line up the bottom edges of the components with the bottom edge of the first selected component. |
Even Space Horizontal | Evenly space the components horizontally between the first and last selected components. |
Even Space Vertical | Evenly space the components vertically between the first and last selected components. |
Same Size Horizontal | Make the components all the same width as the first selected component. |
Same Size Vertical | Make the components all the same height as the first selected component. |
null
layout means that no layout manager is assigned to the container. null
layout (from Swing) is very similar to XYLayout
in that you can put components in a container at specific x,y coordinates relative to the upper left corner of the container. You must specify each component's x,y coordinates in its constraints
property. Later, you can switch to an appropriate portable layout for your design. We recommend never leaving a container in null
for deployment, because components do not adjust well when you resize the parent container. null
also does not adjust well to differences in users and systems.