Add MATERIAL_CHECK_BOX To Tabs Title

8 views
Skip to first unread message

shop.servic...@gmail.com

unread,
Dec 13, 2018, 9:39:53 AM12/13/18
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA NetBeans 8.2
Desktop OS Windows 10 Pro
Simulator 7.?
Device PC, Android 7+ IOS 12.2+

Can you please suggest details of how to best add an colored check box Image to the right of the title text in a Tabs Component?

TabsTitleSwingComponent.JPG (Attached) is the desired affect in my Swing Project. (Using HTML)

There will be 3 colors for the Checkbox (Green, Yellow, Red)  signifying the aggregate state of the Tabs components


            Style s = UIManager.getInstance().getComponentStyle("Tab");
            Image ChkBxImg = FontImage.createMaterial(FontImage.MATERIAL_CHECK_BOX, s);
            MpiInspectionForm.addTab("Mpi Inspection Base", ChkBxImg , new TextArea());

TabsTitleCodename1Component.JPG
(Attached) is the codename1 version using Tabs.addtab with this Icon

TabsTitleSwingComponent.JPG
TabsTitleCodename1Component.JPG

Shai Almog

unread,
Dec 14, 2018, 12:30:02 AM12/14/18
to CodenameOne Discussions
addTab now has a version of the method that accepts a material icon constant specifically: addTab(String title, char materialIcon, float iconSize, Component component).

setTabTextPosition(LEFT) should allow you to determine the position of the text to the left of the icon. Make sure to invoke it before adding tabs.

SSA Support

unread,
Dec 14, 2018, 1:59:43 PM12/14/18
to codenameone...@googlegroups.com
Thank You!

Sent from my iPhone

On Dec 14, 2018, at 12:30 AM, Shai Almog <shai....@gmail.com> wrote:

addTab now has a version of the method that accepts a material icon constant specifically: addTab(String title, char materialIcon, float iconSize, Component component).

setTabTextPosition(LEFT) should allow you to determine the position of the text to the left of the icon. Make sure to invoke it before adding tabs.

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/_zxgM5TaaYQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/ecf75355-daa6-41b9-b6dc-a6603c976428%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages