# Class SurfaceColumn

java.lang.Object
com.codename1.surfaces.SurfaceNode
com.codename1.surfaces.SurfaceContainer
com.codename1.surfaces.SurfaceColumn

public class SurfaceColumn extends SurfaceContainer
A container that stacks its children vertically. Maps to a SwiftUI `VStack`, an Android vertical `LinearLayout` and a vertical box on desktop surfaces.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SurfaceColumn()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SurfaceColumn`
  `add(SurfaceNode child)`
  Adds a child node.
  `int`
  `getSpacing()`
  Returns the gap between consecutive children in dips.
  `SurfaceColumn`
  `setAction(String actionId)`
  Assigns a tap action to this node.
  `SurfaceColumn`
  `setAction(String actionId, Map<String,Object> params)`
  Assigns a tap action with parameters to this node.
  `SurfaceColumn`
  `setAlignment(SurfaceAlignment alignment)`
  Sets this node's alignment within its parent.
  `SurfaceColumn`
  `setBackground(SurfaceColor color)`
  Sets the background color of this node.
  `SurfaceColumn`
  `setCornerRadius(int radius)`
  Sets the corner radius applied to the node's background.
  `SurfaceColumn`
  `setPadding(int all)`
  Sets the same padding on all four sides.
  `SurfaceColumn`
  `setPadding(int top, int right, int bottom, int left)`
  Sets the padding of each side individually.
  `SurfaceColumn`
  `setSize(int widthDips, int heightDips)`
  Sets a fixed size for this node.
  `SurfaceColumn`
  `setSpacing(int spacing)`
  Sets the vertical gap between consecutive children.
  `SurfaceColumn`
  `setWeight(int weight)`
  Sets the flexible-space weight of this node within a row or column.

  ### Methods inherited from class SurfaceContainer

  `getChildren`

  ### Methods inherited from class SurfaceNode

  `getActionId, getActionParams, getAlignment, getBackground, getCornerRadius, getHeightDips, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getWeight, getWidthDips`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SurfaceColumn

    public SurfaceColumn()

- ## Method Details

  - ### setSpacing

    public SurfaceColumn setSpacing(int spacing)

    Sets the vertical gap between consecutive children.

    ###### Parameters

    - `spacing`: the gap in dips

    ###### Returns

    this column, for chaining

  - ### getSpacing

    public int getSpacing()
    Returns the gap between consecutive children in dips.

  - ### add

    public SurfaceColumn add(SurfaceNode child)
    Description copied from class: `SurfaceContainer`

    Adds a child node.

    ###### Parameters

    - `child`: the node to append

    ###### Returns

    this container, for chaining

    Overrides:
      `add` in class `SurfaceContainer`

  - ### setPadding

    public SurfaceColumn setPadding(int all)
    Description copied from class: `SurfaceNode`

    Sets the same padding on all four sides.

    ###### Parameters

    - `all`: padding in dips

    ###### Returns

    this node, for chaining

    Overrides:
      `setPadding` in class `SurfaceNode`

  - ### setPadding

    public SurfaceColumn setPadding(int top, int right, int bottom, int left)
    Description copied from class: `SurfaceNode`

    Sets the padding of each side individually.

    ###### Parameters

    - `top`: top padding in dips
    - `right`: right padding in dips
    - `bottom`: bottom padding in dips
    - `left`: left padding in dips

    ###### Returns

    this node, for chaining

    Overrides:
      `setPadding` in class `SurfaceNode`

  - ### setBackground

    public SurfaceColumn setBackground(SurfaceColor color)
    Description copied from class: `SurfaceNode`

    Sets the background color of this node.

    ###### Parameters

    - `color`: the background color

    ###### Returns

    this node, for chaining

    Overrides:
      `setBackground` in class `SurfaceNode`

  - ### setCornerRadius

    public SurfaceColumn setCornerRadius(int radius)
    Description copied from class: `SurfaceNode`

    Sets the corner radius applied to the node's background. May render square on Android versions below 12.

    ###### Parameters

    - `radius`: the corner radius in dips

    ###### Returns

    this node, for chaining

    Overrides:
      `setCornerRadius` in class `SurfaceNode`

  - ### setAlignment

    public SurfaceColumn setAlignment(SurfaceAlignment alignment)
    Description copied from class: `SurfaceNode`

    Sets this node's alignment within its parent. In a `SurfaceBox` all nine positions apply; in rows and columns only the cross-axis component is used.

    ###### Parameters

    - `alignment`: the alignment

    ###### Returns

    this node, for chaining

    Overrides:
      `setAlignment` in class `SurfaceNode`

  - ### setWeight

    public SurfaceColumn setWeight(int weight)
    Description copied from class: `SurfaceNode`

    Sets the flexible-space weight of this node within a row or column. Nodes with a weight share the leftover space of the parent proportionally; a weight of 0 (the default) sizes the node to its natural size.

    ###### Parameters

    - `weight`: the relative weight, 0 for natural sizing

    ###### Returns

    this node, for chaining

    Overrides:
      `setWeight` in class `SurfaceNode`

  - ### setSize

    public SurfaceColumn setSize(int widthDips, int heightDips)
    Description copied from class: `SurfaceNode`

    Sets a fixed size for this node. A value of 0 (the default) keeps the natural size of the respective axis.

    ###### Parameters

    - `widthDips`: fixed width in dips, 0 for natural width
    - `heightDips`: fixed height in dips, 0 for natural height

    ###### Returns

    this node, for chaining

    Overrides:
      `setSize` in class `SurfaceNode`

  - ### setAction

    public SurfaceColumn setAction(String actionId)
    Description copied from class: `SurfaceNode`

    Assigns a tap action to this node. Tapping the node opens (or foregrounds) the app and delivers the action id to the handler registered with `Surfaces.setActionHandler(...)`. Note that small iOS home-screen widgets only honor the action of the root node.

    ###### Parameters

    - `actionId`: the app-defined action identifier

    ###### Returns

    this node, for chaining

    Overrides:
      `setAction` in class `SurfaceNode`

  - ### setAction

    public SurfaceColumn setAction(String actionId, Map<String,Object> params)
    Description copied from class: `SurfaceNode`

    Assigns a tap action with parameters to this node. The parameter map may contain `String`, `Number` and `Boolean` values and is delivered verbatim with the `SurfaceActionEvent`.

    ###### Parameters

    - `actionId`: the app-defined action identifier
    - `params`: parameters delivered with the action, may be null

    ###### Returns

    this node, for chaining

    Overrides:
      `setAction` in class `SurfaceNode`