encyclopegia.org

layout manager

Layout managers are software components used in widget toolkits which have the ability to lay out graphical control elements by their relative positions without using distance units. It is often more natural to define component layouts in this manner than to define their position in pixels or common distance units, so a number of popular widget toolkits include this ability by default. Widget toolkits that provide this function can generally be classified into two groups: *Those where the layout behavior is coded in special graphic containers. This is the case in XUL and the .NET Framework widget toolkit (both in Windows Forms and in XAML). *Those where the layout behavior is coded in layout managers, that can be applied to any graphic container. This is the case in the Swing widget toolkit that is part of the Java API.

Layout managers are software components used in widget toolkits which have the ability to lay out graphical control elements by their relative positions without using distance units. It is often more natural to define component layouts in this manner than to define their position in pixels or common distance units, so a number of popular widget toolkits include this ability by default. Widget toolkits that provide this function can generally be classified into two groups: Those where the layout behavior is coded in special graphic containers. This is the case in XUL and the .NET Framework widget toolkit (both in Windows Forms and in XAML). Those where the layout behavior is coded in layout managers, that can be applied to any graphic container. This is the case in the Swing widget toolkit that is part of the Java API. ==Examples== Android have the . GTK have the and classes. ===XUL=== In XUL, like the vbox container to stack components on top of each other. This piece of code shows 3 buttons stacked on top of each other in a vertical box. ===XAML=== The DockPanel container lays out children components according to their Dock properties. Top 1 Top 2 Top 3 Top 4 This code shows 4 text blocks on top of each other. ===Java=== The layout manager arranges components in a directional flow, much like lines of text in a paragraph. It arranges components horizontally until no more components fit on the same line, then it places them on another line. Other layout managers are GridLayout managers which arrange the components in grid form and BorderLayout managers which also arranges the component in five parts of the frame, thus: south, north, west, east and center. import javax.swing.JFrame; import javax.swing.JButton; import java.awt.FlowLayout; import java.awt.Container; public class Example { private JFrame frame; public Example() { frame = new JFrame("FlowLayout Demo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new FlowLayout()); frame.add((new JButton("Button 1"))); frame.add((new JButton("Button 2"))); frame.add((new JButton("Button 3"))); frame.add((new JButton("Long-Named Button 4"))); frame.add((new JButton("5"))); frame.pack(); frame.setVisible(true); } public static void main(String[] args) { Example ex = new Example(); } } This code shows 5 buttons alongside each other on the same line: ==References== ==External links== Layout tutorial on Oracle website Layout Manager Showdown on java.net

References

No reference rows published for this article.

Cite this article

MLA

"layout manager." encyclopegia.org, 2025, https://encyclopegia.org/wiki/layout-manager. Accessed 24 November 2026.

Chicago

"layout manager." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/layout-manager.

APA

encyclopegia.org. (2025). layout manager. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/layout-manager

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

Hyder Ali

stub · references available

peer support

stub · references available

Hailu Mekonnen

stub · references available

playlist

stub · references available

horse colic

stub · references available

Papyrus Oxyrhynchus L 3525

stub · references available
CC BY-SA 4.0 · tier1-factual · https://en.wikipedia.org/w/index.php?oldid=1304969861 · 0.55 · snapshot layout-manager-186158-9e4ee50ddd7eee06 · QID Q1594330

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.