Skip to content

GaldurCheckbox

classclient onlysince 0.1.0

com.galdurstudio.galdurui.api.widget.GaldurCheckbox

Themed checkbox.

The widget does not store the state: it reads it every frame from a supplier and asks for changes through a callback. The state lives elsewhere (a GaldurWindow handle, for instance), so it survives the widget being rebuilt on resize.

Example.java
boolean[] sound = {false};column.addChild(GaldurCheckbox.of(Component.literal("Enable sound"),        () -> sound[0], value -> sound[0] = value));
public class GaldurCheckbox extends AbstractWidget
PACKAGEapi.widget
SIDEclient only
EXTENDSAbstractWidget

Constructors 1

GaldurCheckbox

protected
protected GaldurCheckbox(Component label, BooleanSupplier checked, Consumer<Boolean> onToggle)

PARAMETERS

labelComponenttext right of the box
checkedBooleanSuppliersupplier of the current state, called every frame
onToggleConsumer<Boolean>receives the wanted value when the player toggles the box

Methods 2

of

static
public static GaldurCheckbox of(Component label, BooleanSupplier checked, Consumer<Boolean> onToggle)

PARAMETERS

labelComponent—
checkedBooleanSupplier—
onToggleConsumer<Boolean>—

RETURNSGaldurCheckbox — a checkbox at (0, 0), for a layout to place

onClick

public void onClick(double mouseX, double mouseY, int button)

Only remembers the press: the box toggles on release, so the player can cancel by releasing elsewhere.

PARAMETERS

mouseXdouble—
mouseYdouble—
buttonint—
© 2026 Galdur Studio · galdurstudio.com · Discord · LGPL-3.0-onlyNot an official Minecraft product. Not approved by or associated with Mojang or Microsoft.