Skip to content

Instantly share code, notes, and snippets.

@codenameone
Created January 28, 2016 09:14
Show Gist options
  • Save codenameone/a25944769128d5330cd4 to your computer and use it in GitHub Desktop.
Save codenameone/a25944769128d5330cd4 to your computer and use it in GitHub Desktop.
Simple sample of the Codename One table layout
Form hi = new Form("Table Layout 2x2", new TableLayout(2, 2));
hi.add(new Label("First")).
add(new Label("Second")).
add(new Label("Third")).
add(new Label("Fourth")).
add(new Label("Fifth"));
hi.show();
@codenameone
Copy link
Author

Sample usage code for TableLayout

Notice that the sample creates a 2x2 table and adds 5 elements. Unlike the grid layout sample the fifth element just won't show.

From the Codename One project

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