B4X Store
jdashboardUI / Menus & Navigation / jbtfloating
Menus & Navigation

jbtfloating

Floating action button with expandable items, icons and tooltips.

Search all jdashboardUI docs
Source
jdashboardUI.b4xlib · Public API only
Store language: en

JDashboardUI · Complete API guide · B4J/JavaFX · October 30, 2026 source bundle

Floating action button with expandable icon/image actions, tooltips, shadow options and animation styles.

Illustrative component mockup for jbtfloating

Illustrative documentation mockup, not an exact control screenshot.

What it does and when to use it

Floating action button with expandable icon/image actions, tooltips, shadow options and animation styles.

Initialization and practical examples

The example demonstrates the available operations. Root, where used, refers to an existing B4XView. Example image files must actually be included in the project's Files folder.

' Floating action button with an expandable menu
Private Fab As jbtfloating
Private Fonts As JIconFont
Fonts.Initialize
Fab.Initialize(Me, "Fab")
Fab.AddToParent(Root, 540dip, 290dip, 56dip, 56dip, _
    xui.Color_RGB(67, 56, 202), xui.Color_White)
Fab.lcon(Fonts.IconFontAwesomeSolid, Chr(0xF067))
Fab.InitializeMenu(True, Root)
Fab.additemIcon("New", xui.Color_White, 12, Chr(0xF067), _
    Fonts.IconFontAwesomeSolid, xui.Color_White, _
    xui.Color_RGB(16,185,129), "Create a new record")
Fab.SetShadowOpacity(160)
Fab.AnimationType = 1

' Custom image item (file must exist in the project's Files)
Fab.additemImage("Profile", xui.Color_White, 12, File.DirAssets, _
    "avatar.png", 20, xui.Color_RGB(54,60,88), "Profile", False)

' Event callbacks
Private Sub Fab_ItemClicked(Item As String, Index As Int)
    Log(Item & " index=" & Index)
End Sub

Private Sub Fab_Click(Open As Boolean)
    Log("Open: " & Open)
End Sub

Complete public API reference

This module exposes 21 public methods/accessors in the inspected version. All declarations, including variants, getters/setters and Designer lifecycle hooks, appear below.

Exact source declaration Purpose
InitializeMenu(Down As Boolean, Parent As B4XView) Configures the floating action menu and its opening direction.
additemIcon(Text As String, txtColor As Int, txtsize As Int, Icon As String, Iconfont As B4XFont, IconColor1 As Int, BackgroundColor As Int, ToolTipText As String) Adds a glyph-based action with colors and tooltip.
additemImage(Text As String, txtColor As Int, txtsize As Int, ImageDir As String, ImageFile As String, ImageSize As Float, BackgroundColor As Int, ToolTipText As String, ShowAsBadge As Boolean) Adds an image-based action with tooltip and optional badge style.
SetShadowOpacity(Alpha As Int) Sets shadow opacity (0–255).
Initialize(Callback As Object, EventName As String) Initializes the instance and, when required, binds Callback and EventName.
SetToolTip(Text As String, IconFont As B4XFont, Icon As String, IconColor2 As Int) Configures a tooltip with a font glyph.
SetToolTip2(Text As String, ImageDir As String, ImageName As String) Configures a tooltip with an image.
ItemLabel(index As Int) As Label Returns an item label by index.
HideMenu Hides the expanded action list.
DesignerCreateView(Base As Object, Lbl As Label, Props As Map) Designer lifecycle hook; not called manually.
AddToParent(parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int, backgound As Int, IconTextColor As Int) Inserts the control into Parent with geometry and initial options.
Elevation(size As Float, color As Int) Applies visual elevation and shadow.
setColorBg(colorbg As Int) Configures ColorBg; single-argument setters commonly use B4X property syntax.
lcon(font As B4XFont, icon As String) Sets the main font icon; note the name starts with lowercase L.
setlogo(filedir As String, filename As String, size As Int) Sets the main image logo.
GetBase As Pane Returns the underlying Pane in B4J.
setLeft(Left As Int) Configures Left; single-argument setters commonly use B4X property syntax.
setTop(Top As Int) Configures Top; single-argument setters commonly use B4X property syntax.
setVisible(Flag As Boolean) Configures Visible; single-argument setters commonly use B4X property syntax.
setIconTextColor(Color As Int) Configures IconTextColor; single-argument setters commonly use B4X property syntax.
setShowAsBadge(v As Boolean) Configures ShowAsBadge; single-argument setters commonly use B4X property syntax.

B4X properties: read/write access

Public getX/setX members correspond to standard B4X Control.X property syntax when their signatures are property-compatible. Use multi-argument members as methods.

Property Access
ColorBg write
Left write
Top write
Visible write
IconTextColor write
ShowAsBadge write

Public fields

  • mBase As B4XView
  • Tag As Object
  • AnimationType As Int

Designer properties

  • IconColor
  • ColorExample

Events

  • Click(open As Boolean)
  • ItemClicked(Item As String, Index As Int)
  • MouseEntered
  • MouseExited

Lifecycle, compatibility and limitations

The actual method name is lcon (lowercase L), not Icon. On B4J GetBase returns Pane; a conditional B4A implementation also exists.

DesignerCreateView and Base_Resize, where listed, are Custom View lifecycle hooks managed by B4J. Normally you should not call them manually. When adding the view through the Designer, do not initialize the same instance again.

Icon Choose: the sample bundled with JDashboardUI allows searching and previewing glyphs, selecting colors, and copying Chr(0x...) and B4X color values. TTF assets are bundled in the library.

API conventions

  • All signatures and argument types come from the inspected source bundle.
  • B4XView denotes an XUI view, B4XFont an XUI font, and Object an arbitrary value.
  • Variable names in samples are illustrative: use those from your actual project.
  • Source review was performed; no real B4J compilation was performed in this environment.