All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.codename1.ui.layouts.package.html Maven / Gradle / Ivy

There is a newer version: 7.0.161
Show newest version


  
    
  
    
        

Layout managers allow a {@link com.codename1.ui.Container} to arrange its components by a set of rules that adapt to specific densities (ppi - pixels per inch). A layout manager is an arranging algorithm encapsulated by an abstract class implementation that places components absolutely based on the "hints" received.

Layout Managers that ship with Codename One

{@link com.codename1.ui.layouts.FlowLayout} is default layout manager, simple, flexible and with a few caveats.

Simple FlowLayout

{@link com.codename1.ui.layouts.BorderLayout} is ubiquitous thru Codename One code.

Border Layout

{@link com.codename1.ui.layouts.BorderLayout} can also behave differently based on the center behavior flag

Border Layout Center

{@link com.codename1.ui.layouts.BoxLayout} Y axis is a the work-horse of component lists

Box Layout Y

{@link com.codename1.ui.layouts.BoxLayout} X axis is a simpler replacement to flow layout and has grow/no grow variants.

Box Layout X
Box Layout X No Grow

{@link com.codename1.ui.layouts.GridLayout} arranges elements in a grid where all elements have an equal size. It can auto adapt the column count.

Grid Layout 2x2 Grid Layout autofit landscape

{@link com.codename1.ui.table.TableLayout} is similar in many regards to HTML tables. Notice that its in the com.codename1.ui.table package and not in this package.

TableLayout that grows the last column TableLayout with complex constraints

{@link com.codename1.ui.layouts.LayeredLayout} is unique in the sense that it is meant to costruct layers and not the UI positions. It only lays out on the Z axis.

The X on this button was placed there using the layered layout code below

{@link com.codename1.ui.layouts.GridBagLayout} was added to Codename One to ease the porting of Swing/AWT applications.

Sample gridbag layout usage

{@link com.codename1.ui.layouts.mig.MigLayout} is a popular 3rd party layout manager its Codename One port is experimental.

MiG Layout




© 2015 - 2024 Weber Informatics LLC | Privacy Policy