B4X Store
jdashboardUI / Inputs & Controls / jCheckbox
Inputs & Controls

jCheckbox

Checkable input with customizable glyphs, images, colors and state.

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

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

Customizable checkbox with font glyphs, images, text, animations, disabled states and events.

Illustrative component mockup for jCheckbox

Illustrative documentation mockup, not an exact control screenshot.

What it does and when to use it

Customizable checkbox with font glyphs, images, text, animations, disabled states and events.

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.

' Custom checkbox from code
Private C As jCheckbox
C.Initialize(Me, "C")
C.AddToParent(Root, 20dip, 20dip, 300dip, 38dip, 10dip, False, "Notifications")

' Configure state, text and typography
C.Checked = True
C.CheckedAnimated = True
C.TextColor = xui.Color_Black
C.TextFontSize = 15
C.TextBold = True
C.Enabled = True
C.IsEvent = True

' Customize checked-state icon
Private Fonts As JIconFont
Fonts.Initialize
Fonts.FontSize = 20
C.SetIcon(Chr(0xF00C), Fonts.IconFontAwesomeSolid)
C.IconColor = xui.Color_White
C.IconSize = 18
C.CheckedBackgroundColor = xui.Color_RGB(16, 185, 129)
C.BorderCornerRadius = 10
C.BorderWidth = 2

' Alternative: use an image instead of the icon
C.SetImage(File.DirAssets, "check.png", True)

' Callback
Private Sub C_CheckedChange(Checked As Boolean)
    Log("Checked: " & Checked)
End Sub

Complete public API reference

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

Exact source declaration Purpose
Initialize(Callback As Object, EventName As String) Initializes the instance and, when required, binds Callback and EventName.
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, CornerRadius As Int, Checked As Boolean, Text As String) Inserts the control into Parent with geometry and initial options.
Base_Resize(Width As Double, Height As Double) Updates internal layout when resized; lifecycle hook.
setText(Text As String) Configures Text; single-argument setters commonly use B4X property syntax.
getText As String Reads the Text property.
setTextColor(Color As Int) Configures TextColor; single-argument setters commonly use B4X property syntax.
getTextColor As Int Reads the TextColor property.
setChecked(Checked As Boolean) Configures Checked; single-argument setters commonly use B4X property syntax.
getChecked As Boolean Reads the Checked property.
setTextFontType(Font As B4XFont) Configures TextFontType; single-argument setters commonly use B4X property syntax.
getTextFontType As B4XFont Reads the TextFontType property.
SetIcon(Icon As String, Font As B4XFont) Sets the checked-state glyph and B4XFont.
getIcon As String Reads the Icon property.
setIconFont(Font As B4XFont) Configures IconFont; single-argument setters commonly use B4X property syntax.
getIconFont As B4XFont Reads the IconFont property.
setIconSize(Size As Float) Configures IconSize; single-argument setters commonly use B4X property syntax.
getIconSize As Float Reads the IconSize property.
SetImage(FileDir As String, FileName As String, KeepAspectRatio As Boolean) Uses an image for the checked state; KeepAspectRatio preserves proportions.
setBorderCornerRadius(Radius As Int) Configures BorderCornerRadius; single-argument setters commonly use B4X property syntax.
setBorderWidth(Width As Int) Configures BorderWidth; single-argument setters commonly use B4X property syntax.
getIconColor As Int Reads the IconColor property.
setIconColor(Color As Int) Configures IconColor; single-argument setters commonly use B4X property syntax.
setCheckedBackgroundColor(Color As Int) Configures CheckedBackgroundColor; single-argument setters commonly use B4X property syntax.
getCheckedBackgroundColor As Int Reads the CheckedBackgroundColor property.
setCheckedAnimated(Animated As Boolean) Configures CheckedAnimated; single-argument setters commonly use B4X property syntax.
setEnabled(Enable As Boolean) Configures Enabled; single-argument setters commonly use B4X property syntax.
getEnabled As Boolean Reads the Enabled property.
getDisabledBackgroundColor As Int Reads the DisabledBackgroundColor property.
setDisabledBackgroundColor(Color As Int) Configures DisabledBackgroundColor; single-argument setters commonly use B4X property syntax.
getDisabledIconColor As Int Reads the DisabledIconColor property.
setDisabledIconColor(Color As Int) Configures DisabledIconColor; single-argument setters commonly use B4X property syntax.
getIsHaptic As Boolean Reads the IsHaptic property.
setIsHaptic(Enabled As Boolean) Configures IsHaptic; single-argument setters commonly use B4X property syntax.
getIsEvent As Boolean Reads the IsEvent property.
setIsEvent(Enabled As Boolean) Configures IsEvent; single-argument setters commonly use B4X property syntax.
setTextFontSize(FontSize As Float) Configures TextFontSize; single-argument setters commonly use B4X property syntax.
setTextBold(Bold As Boolean) Configures TextBold; single-argument setters commonly use B4X property syntax.
getTextFontSize As Float Reads the TextFontSize property.
getTextBold As Boolean Reads the TextBold property.

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
Text read / write
TextColor read / write
Checked read / write
TextFontType read / write
Icon read
IconFont read / write
IconSize read / write
BorderCornerRadius write
BorderWidth write
IconColor read / write
CheckedBackgroundColor read / write
CheckedAnimated write
Enabled read / write
DisabledBackgroundColor read / write
DisabledIconColor read / write
IsHaptic read / write
IsEvent read / write
TextFontSize read / write
TextBold read / write

Public fields

  • mBase As B4XView
  • Tag As Object

Designer properties

  • CheckedBackgroundColor
  • IconColor
  • DisabledBackgroundColor
  • DisabledIconColor
  • BorderWidth
  • BorderCornerRadius
  • CheckedAnimated
  • HapticFeedback
  • Checked
  • Enabled
  • Text
  • TextColor
  • TextFontSize
  • TextBold

Events

  • CheckedChange(Checked As Boolean)

Lifecycle, compatibility and limitations

SetIcon and SetImage are alternative checked-state visuals. Features such as haptic feedback depend on platform capabilities.

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.