A Java port of Bubble Tea, a powerful terminal UI framework. Boba enables the creation of rich terminal user interfaces including games using a functional, message-passing architecture.
- Java 22+
- Terminal with ANSI support
A basic counter application demonstrating core concepts:
public class Counter extends Program<Model> {
@Override
public UpdateResult<Model> update(Model model, Msg msg) {
switch (msg) {
case Msg.KeyClickMsg(char key) -> {
if (key == 'w') model.count++;
else if (key == 's') model.count--;
else if (key == 'q') System.exit(0);
}
default -> {}
}
return new UpdateResult<>(model, null);
}
@Override
public String view(Model model) {
return "Count: " + model.count + "\n'w' to increment, 's' to decrement, 'q' to quit";
}
}We use the slf4j logging framework. You will need to include a logging implementation like logback-classic as seen below. There is a default logback.xml provided so the actual program isn't interrupted by unexpected logging. By default, it logs to a file called app.log, but it is highly recommended to either disable logging completely or log to your own file.
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>- Non char inputs (arrow keys, control, combinations, ect..)
- Mouse scrolling support
- Layout API
- Look at MacTerminal#makeCooked (figure out why its not working)
We follow the Calendar Versioning schema (YYYY.M.D[.MODIFIER])