Skip to content

Instantly share code, notes, and snippets.

@codenameone
Created February 12, 2016 08:09
Show Gist options
  • Save codenameone/ba27124a0a25e685b123 to your computer and use it in GitHub Desktop.
Save codenameone/ba27124a0a25e685b123 to your computer and use it in GitHub Desktop.
Simple Tabs component sample from Codename One
Form hi = new Form("Tabs", new BorderLayout());
Tabs t = new Tabs();
Style s = UIManager.getInstance().getComponentStyle("Tab");
FontImage icon1 = FontImage.createMaterial(FontImage.MATERIAL_QUESTION_ANSWER, s);
Container container1 = BoxLayout.encloseY(new Label("Label1"), new Label("Label2"));
t.addTab("Tab1", icon1, container1);
t.addTab("Tab2", new SpanLabel("Some text directly in the tab"));
hi.add(BorderLayout.CENTER, t);
@codenameone
Copy link
Author

Sample usage code for Tabs.

From the Codename One project

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