Skip to content

ProgressHandle

classclient onlysince 0.1.0

com.galdurstudio.galdurui.api.window.ProgressHandle

Handle to a progress bar of a GaldurWindow: its progress and the text shown on it.

Returned by addProgress(...). The shown widget reads the progress and the text every frame: change them as often as you like (every tick, for instance), even while the window is open, without rebuilding the screen.

Example.java
ProgressHandle craft = window.addProgress(Component.literal("Iron ingots: 0 / 64"));craft.setProgress(16, 64);craft.setLabel(Component.literal("Iron ingots: 16 / 64"));

The bar width is computed when the screen is built, from the text. A longer text given later is cut with "…" until the next rebuild (resize, or an element added to the window). Like any ElementHandle, the bar can be disabled (muted colours), hidden or given a tooltip.

Call on the client thread.

public class ProgressHandle extends ElementHandle
PACKAGEapi.window
SIDEclient only

MEMBERS · 11

Methods 10

getProgress

public double getProgress()

RETURNSdouble — the progress, from 0 (empty) to 1 (full)

setProgress

2 overloads
public void setProgress(double progress)
public void setProgress(long done, long total)

Changes the progress.

PARAMETERS

progressdoublefrom 0 (empty) to 1 (full); values outside are clamped, and NaN counts as 0
donelongwhat is done
totallongthe total; when 0 or less, the bar is empty

getLabel

public Component getLabel()

RETURNSComponent — the text shown on the bar, or null if none

setLabel

public void setLabel(Component label)

Changes the text shown on the bar.

PARAMETERS

labelComponentthe new text, or null for none
public void setEnabled(boolean enabled)

Enables or disables the element. No effect if it is already in that state.

PARAMETERS

enabledbooleanfalse to disable it
public boolean isEnabled()

RETURNSboolean — true if the element is enabled (the default)

public void setVisible(boolean visible)

Shows or hides the element. Hidden, it frees its space in the window. No effect if it is already in that state.

PARAMETERS

visiblebooleanfalse to hide it
public boolean isVisible()

RETURNSboolean — true if the element is shown (the default)

public void setTooltip(Component tooltip)

Sets the text shown when the element is hovered.

PARAMETERS

tooltipComponentthe tooltip text, or null to remove it
public Component getTooltip()

RETURNSComponent — the tooltip text, or null if none

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