Abstractics XmlPanel
A flexible Java Swing Runtime Layout Manager Current Version: 1.1

Floating Components

Layout managers are extremely beneficial for dealing with window resizing and arranging components in a logical manner. But sometimes you just want to tell a component exactly where to be placed and what size it should be. With version 1.1 of the XmlPanel, you can now do exactly that.

The <comp> Element

The format for the XML in a layout has a series of <row> tags as children to the parent <panel> tag. You can now also create <comp> tags as children as well. This tag is used to specify a "floating" component. A component that is placed directly where you tell it to be placed.

The <comp> element requires an attribute called bounds. Bounds specify the X/Y location of the top/left corner of the component, along with the width and height of the component. For example, the following would place a button component with its top/left corner at position (20,30), with a width of 150 pixels, and a height of 50 pixels:

<comp type="button" bounds="20,30,150,50" font="Arial,bold,14">Some Button</comp>

This is the text that comes next.