Skip to content

JSignal

Declarative desktop GUI library for Java

Signals & Effects

Fine-grained reactivity and automatic dependency tracking makes rendering fast and state management intuitive.

Hotswap

Code changes intelligently trigger parts of the component tree to be rerendered without stopping the application.

Skia Graphics

Powerful canvas API with support for advanced software and hardware rendering on all major desktop platforms.

Yoga Layout

Use familiar, web-standard Flexbox layouts

Example

public class Counter extends Component {
public static void main(String[] args) {
UiThread.start(() -> {
var window = UiUtil.createWindow();
window.setTitle("Counter");
window.setContentSize(250, 250);
new UiWindow(window, Counter::new);
});
}
private final Signal<Integer> count = Signal.create(0);
@Override
public Element render() {
return Node.builder()
.layoutBuilder(lb -> lb
.fill()
.center()
.column()
.gap(10f)
)
.children(Nodes.compose(
Para.builder()
.string(() -> "Count: " + count.get())
.styleBuilder(sb -> sb.textStyleBuilder(tsb -> tsb
.fontSize(20f)
.color(EzColors.BLUE_500)
))
.build(),
Button.builder()
.color(EzColors.BLUE_300)
.action(() -> count.accept(c -> c + 1))
.children(() -> Para.fromString("Increment"))
.build()
))
.build();
}
}