B4X Store
jdashboardUI / Menus & Navigation / JTabBar
Menus & Navigation

JTabBar

Animated horizontal navigation with text, images/icons and direct Visible/Enabled properties.

Search all jdashboardUI docs
Source
jdashboardUI.b4xlib · Public API only
Store language: en
Reference visual
Documentation reference created from the real component type. It is not an exact screenshot.
REFERENCE
JTabBarREFERENCEHomeFilesSettings

Menus & Navigation · jdashboardUI · B4J / JavaFX

JTabBar creates animated horizontal navigation with text, image or icon options. It can be created from the Designer or with AddToParent.

The image shown here is a visual reference created for the documentation, not a pixel-perfect screenshot.

Basic example

JTabBar1.AddOptions(Array As String("Home", "Files", "Settings"))
JTabBar1.Show
JTabBar1.Active = 0

Visible and Enabled

The current version exposes these properties directly:

JTabBar1.Visible = False
JTabBar1.Visible = True

JTabBar1.Enabled = False
JTabBar1.Enabled = True

When Enabled = False or Visible = False, the control does not process clicks or raise the selection event. There is no need to access mBase manually.

Image or icon options

JTabBar1.AddTextWithImage("Files", File.DirAssets, "folder.png", "Files")
JTabBar1.AddTextWithIcon("Settings", Chr(0xE8B8), xui.Color_Blue, xui.CreateMaterialIcons(18), "Settings")
JTabBar1.Show

Event

Private Sub JTabBar1_itemClicked(Text As String, Index As Int)
    Log(Text & " / " & Index)
End Sub

Complete public API

  • Initialize(Callback As Object, EventName As String)
  • DesignerCreateView(Base As Object, Lbl As Label, Props As Map)
  • AddToParent(parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)
  • setCornerRadius(Radius As Int)
  • AddOption(Text As String)
  • AddOptions(Texts As List)
  • AddTextWithImage(Text As String, ImageDir As String, ImageFileName As String, Toltip As String)
  • AddTextWithIcon(Text As String, Icon As String, IconColor As Int, IconFont As B4XFont, TolTip As String)
  • setActive(Number As Int)
  • setActive2(Text As String)
  • Show()
  • setVisible(Value As Boolean)
  • getVisible() As Boolean
  • setEnabled(Value As Boolean)
  • getEnabled() As Boolean
  • setActiveColor(Color As Int)
  • setTextColor(Color As Int)
  • setTextSize(sizee As Int)
  • setFonts(setfont As B4XFont)
  • setAnimationTime(MilliSecond As Int)
  • setBackgroundColor(Color As Int)
  • setBorderColor(BorderColor As Int)
  • getSize() As Int
  • getTexts() As List
  • getActiveIndex() As Int
  • getActiveValue() As String
  • setDropShadow(color As Int)