Skip to content

Instantly share code, notes, and snippets.

@codenameone
Created January 28, 2016 12:47
Show Gist options
  • Save codenameone/573f73164df4af00b7b1 to your computer and use it in GitHub Desktop.
Save codenameone/573f73164df4af00b7b1 to your computer and use it in GitHub Desktop.
A more elaborate example that shows off complex Codename One TableLayout usage
TableLayout tl = new TableLayout(2, 3);
Form hi = new Form("Table Layout Cons", tl);
hi.setScrollable(false);
hi.add(tl.createConstraint().
widthPercentage(20),
new Label("AAA")).
add(tl.createConstraint().
horizontalSpan(2).
heightPercentage(80).
verticalAlign(Component.CENTER).
horizontalAlign(Component.CENTER),
new Label("Span H")).
add(new Label("BBB")).
add(tl.createConstraint().
widthPercentage(60).
heightPercentage(20),
new Label("CCC")).
add(tl.createConstraint().
widthPercentage(20),
new Label("DDD"));
@codenameone
Copy link
Author

Sample usage code for TableLayout

From the Codename One project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment