Experimenting with Javelit - The Streamlit for Java
Source: Dev.to
Starting from the Python development ecosystem
At the beginning of my journey with agentic applications, I started with the Python programming language, leveraging LangChain / LangGraph.
For testing and documentation, I relied on the simple yet powerful Jupyter Notebooks.
Simultaneously, for rapid prototyping, I adopted the amazing Streamlit framework, which empowered me to quickly develop functional applications with an effective UI and excellent UX.
Moving from the Python ecosystem to the Java one
When I started developing LangGraph4j, I tried to replicate my Python development ecosystem in Java.
- I experimented with Java Notebooks through the rapaio‑jupyter‑kernel project, which let me reproduce the development experience I had with Jupyter Notebooks in Python.
- For rapid prototyping, I relied almost entirely on the Spring Boot framework, which provides a fairly fast and enjoyable programming experience.
Javelit comes to play 🚀
While working on LangGraph4j and continuously monitoring the most interesting and promising Java projects on GitHub, I discovered Javelit. This project intrigued me because of its reference to Streamlit, and after a review I was amazed to realize that the dynamic programming model popularized by Streamlit had been adapted for Java by this initiative—cool! 😎
So I started to evaluate it as part of my Java development ecosystem, and below I’ll share my experience with it.
What is Javelit 👀
Javelit is a tool to quickly build interactive app front‑ends in Java, particularly for data apps (but not limited to them). It helps you develop rapid prototypes with a live‑reload loop, so you can experiment and update the app instantly.
How it works
Javelit’s architecture allows you to write apps the same way you write plain Java methods. Whenever something must be updated on the screen, Javelit reruns your entire Java main method from top to bottom.
Think of it as if your entire UI code runs inside a continuous loop that refreshes whenever something needs updating on the screen.
Javelit provides developers with a rich set of pre‑built components that make it easy to get started.
“Hello World” example
///usr/bin/env jbang "$0" "$@" ; exit $?
import io.javelit.core.Jt;
public class App {
public static void main(String[] args) {
Jt.title("Hello World!").use();
Jt.markdown("""
## My first official message
Hello World!
""").use();
}
}
Once Javelit is installed, run the app with:
javelit run App.java
Using Javelit with LangGraph4j
I decided to use Javelit to develop some examples of LangGraph4j usage. Below is a demo app that runs the LangGraph4j‑powered React Agent.
For simplicity I show only the meaningful code snippets; the full source can be found in JtAgentExecutorApp.java (a Spring AI‑based implementation).
As with Streamlit, a Javelit application consists of a single main() method.
import io.javelit.core.Jt;
import io.javelit.core.JtComponent;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.agent.AgentExecutor;
import org.springframework.ai.agent.graph.GraphInput;
import org.springframework.ai.chat.messages.UserMessage;
import java.time.Instant;
import java.util.Map;
import java.util.stream.Collectors;
public class JtAgentExecutorApp {
public static void main(String[] args) {
Jt.title("LangGraph4J React Agent").use();
try {
// Create a LangGraph4j Agent
var agent = AgentExecutor.builder()
.chatModel(/* instantiate the preferred ChatModel */)
.toolsFromObject(new MyTools() /* Custom Tools */)
.build()
.compile();
// Input: the user message
var userMessage = Jt.textArea("user message:")
.placeholder("user message")
.labelVisibility(JtComponent.LabelVisibility.HIDDEN)
.use();
// Button: start agent processing
var start = Jt.button("start agent")
.disabled(userMessage.isBlank())
.use();
if (start) { // if button pressed
var outputComponent = Jt.expander("Workflow Steps").use();
var input = GraphInput.args(
Map.of("messages", new UserMessage(userMessage)));
var generator = agent.stream(input);
final var startTime = Instant.now();
for (var step : generator) {
Jt.sessionState().remove("streaming");
Jt.info(String.format("""
#### %s
%s
""",
step.node(),
step.state().messages().stream()
.map(Object::toString)
.collect(Collectors.joining("\n\n")))
).use();
// Additional UI updates (e.g., progress, logs) could go here
}
var elapsed = Instant.now().minusMillis(startTime.toEpochMilli()).toString();
Jt.success("Agent finished in " + elapsed).use();
}
} catch (Exception e) {
Jt.error("An error occurred: " + e.getMessage()).use();
}
}
}
This snippet demonstrates:
- Title & markdown rendering with
Jt.titleandJt.markdown. - User input via
Jt.textArea. - Action button with
Jt.button. - Dynamic UI updates (expander, info logs) while streaming the agent’s workflow.
Takeaways
- Javelit brings the Streamlit‑style reactive programming model to Java, making rapid UI prototyping straightforward.
- The continuous‑loop execution model means you can think of UI code as a pure function of the current state—no explicit event listeners are required.
- Integrating LangGraph4j (or any other Java AI library) is as simple as placing the agent logic inside the
mainmethod and using Javelit components to display inputs, outputs, and intermediate steps.
Give Javelit a try the next time you need a quick Java‑based data‑app or an interactive demo for your LangGraph4j agents!
Screenshots
Chat model selection view
Start agent view
Results view
👉 Try it yourself 👀 🚀 🤯
If you have installed Javelit, run the following command:
javelit run https://github.com/langgraph4j/langgraph4j/tree/main/spring-ai/spring-ai-agent/src/test/java
Conclusion
Javelit brings the power of rapid prototyping and interactive web‑app development to the Java ecosystem, much like Streamlit does for Python. With its simple, loop‑based programming model, developers can quickly build data‑driven applications without needing extensive frontend knowledge, leveraging familiar Java syntax and the rich JVM ecosystem.
The live‑reload feature enables instant experimentation and iteration, making it ideal for prototyping AI agents, data visualizations, and interactive tools. By integrating seamlessly with libraries like LangGraph4j together with both Spring AI and LangChain4j, Javelit empowers Java developers to create engaging user interfaces effortlessly, bridging the gap between backend logic and user‑facing applications.
Check out the project, give it a try, and let me know your feedback. Happy coding! 👋
References
Originally published at https://bsorrentino.github.io on December 20, 2025.


