# VisualContainerBean

Import: `import com.install4j.api.beans.VisualContainerBean;`

```java
interface VisualContainerBean extends Bean
```

Implemented by beans that contain visual components.


**See also:**

- [Screen](../screens/Screen.md)
- [Style](../styles/Style.md)

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`isFillVertical()`](#isfillvertical) | `boolean` | Returns whether the visual component wants to grow in the vertical direction. |
| [`isFillHorizontal()`](#isfillhorizontal) | `boolean` | Returns whether the visual component wants to grow in the horizontal direction. |
| [`getAnchor()`](#getanchor) | `Anchor` | Returns the position where the visual component should be anchored. |

### isFillVertical()

```java
boolean isFillVertical()
```

Returns whether the visual component wants to grow in the vertical direction. If not,
the visual component will be aligned at the top of the available space and be sized at its
preferred vertical size. If, for example, you have a list in your layout that should
use as much vertical space as possible, you should return `true` here. In that case
you would also want to return `true` in `isFillHorizontal`. If all
your components are fixed-size components, return `false`.

In console or unattended mode, this method is never called.


**Returns:** `true` or `false`.

**See also:**

- [VisualContainerBean.isFillHorizontal](VisualContainerBean.md#isfillhorizontal)

### isFillHorizontal()

```java
boolean isFillHorizontal()
```

Returns whether the visual component wants to grow in the horizontal direction. If not,
the visual component will be aligned at the left of the available space and be sized at its
preferred horizontal size. If, for example, you have text fields in your layout that should
use as much horizontal space as possible, you should return `true` here. If all your components
are fixed-size components, return `false`.

In console or unattended mode, this method is never called.


**Returns:** `true` or `false`.

**See also:**

- [VisualContainerBean.isFillVertical](VisualContainerBean.md#isfillvertical)

### getAnchor()

```java
Anchor getAnchor()
```

Returns the position where the visual component should be anchored.
The effect of this value is linked to the return values of [`VisualContainerBean.isFillHorizontal`](VisualContainerBean.md#isfillhorizontal) and [`VisualContainerBean.isFillVertical`](VisualContainerBean.md#isfillvertical):
- If both [`VisualContainerBean.isFillHorizontal`](VisualContainerBean.md#isfillhorizontal) and [`VisualContainerBean.isFillVertical`](VisualContainerBean.md#isfillvertical) return false, all anchor values
have distinct effects.
- If only [`VisualContainerBean.isFillHorizontal`](VisualContainerBean.md#isfillhorizontal) returns true, _only the vertical part_ of the anchor is used.
- If only [`VisualContainerBean.isFillVertical`](VisualContainerBean.md#isfillvertical) returns true, _only the horizontal part_ of the anchor is used.
- If both [`VisualContainerBean.isFillHorizontal`](VisualContainerBean.md#isfillhorizontal) and [`VisualContainerBean.isFillVertical`](VisualContainerBean.md#isfillvertical) return true, this value has _no effect_.


**Returns:** the anchor

