Class WHBoxLayout

All Implemented Interfaces:
WLayoutItem

public class WHBoxLayout
extends WBoxLayout
A layout manager which arranges widgets horizontally.

This convenience class creates a horizontal box layout, laying contained widgets out from left to right.

See the WBoxLayout documentation for available member methods and more information.

Usage example:


 WContainerWidget w = new WContainerWidget(this);

 WHBoxLayout layout = new WHBoxLayout();
 layout.addWidget(new WText("One"));
 layout.addWidget(new WText("Two"));
 layout.addWidget(new WText("Three"));
 layout.addWidget(new WText("Four"));

 w.setLayout(layout);

 

Note: First consider if you can achieve your layout using CSS !

See Also:
WVBoxLayout
  • Constructor Details

    • WHBoxLayout

      public WHBoxLayout​(WWidget parent)
      Creates a new horizontal box layout.

      Use parent = null to create a layout manager that can be nested inside other layout managers, or to specify a specific alignment when setting the layout to a WContainerWidget.

    • WHBoxLayout

      public WHBoxLayout()
      Creates a new horizontal box layout.

      Calls this((WWidget)null)