craftforJ
craftforJ 是与 webforJ 一并提供的视觉开发环境。它在开发模式下运行于您的应用程序中,并实时展示您的 Java 代码所创建的组件。您可以选择组件,修改其属性,看到正在运行的应用程序立即更新,并将您希望保留的更改写回创建它们的 Java 文件中。
因为 craftforJ 通过 webforJ 读取应用,因此它使用您编写时的术语来描述应用。树状图列出了您的组件,而不是浏览器渲染的标记,属性是您组件声明的,路由是您的路由器注册的,以及您注解的访问规则。
您可以用它做什么
- 检查组件 - 浏览组件树,通过点击页面中的组件来选择,并在应用程序运行时更改其属性。
- 将更改写入源代码 - 以差异的形式查看您的实时编辑并将其应用到您的 Java 文件中。
- 使用路由 - 查看路由表,导航到任何路由,修改其声明的访问规则。
- 设置应用主题 - 调整您的应用所基于的设计令牌,并将结果保存至您的样式表中。
- 使用 AI 代理 - 在正在运行的应用中,编写 Java 代码的 代理,能够自由编写、编译其所写内容,并在您批准后应用。
它与调试器的不同之处
调试器会暂停您的代码,并显示您变量的状态。craftforJ 则保持应用运行,并展示您的代码所生成的界面,让您与结果进行交互,而不是与执行过程打交道。这两者回答的问题不同,通常可以一起使用。
仅限开发模式
craftforJ 需要启用两个独立的设置,默认情况下,它仅对与应用运行在同一机器上的浏览器做出响应。使用 startforJ 创建的项目或从 webforJ 原型 中创建的项目默认启用该功能,因此在您第一次运行时即可使用。请参阅 安全性 以了解 craftforJ 可以访问的内容以及如何在生产环境中确认其已关闭。
主题
开始使用
Add the devtools dependency, enable craftforJ in your configuration, and open craftforJ over a running webforJ app.
检查组件
Browse the component tree webforJ built, select components from the page, and change their properties while the app runs.
应用更改
Review the changes you made in craftforJ as a diff, choose where each one is written, and apply them to your Java source.
路由
See every registered route in a running webforJ app, navigate to it from craftforJ, and change the access rules declared on it.
主题
Adjust the DWC design tokens of a running webforJ app, preview the result immediately, and save it into your stylesheet.
AI 助手
A coding agent that works inside your running webforJ app, writes Java freely behind a compile gate, and applies changes with your approval.
配置
Every craftforJ configuration property, its default, and what turning each feature off changes.
安全
What craftforJ can reach in your project, how it restricts access, and how to confirm it's disabled in production.
应用信息
Read the versions, Java runtime, and project root of the app craftforJ is attached to.
故障排除
Fix the common cases where craftforJ doesn't appear, a feature is unavailable, or the assistant doesn't answer.
继续学习

短短视频 · YouTubeChange a Java web app layout in the browser, no CSS
文章Edit a running Java app with AI in craftforJ
文章Low code to pro code in Java: visual editing with no lock-in
文章What's new in version 26.03?
文章MCP server for Java framework docs: webforJ setup guide
文章What's new in version 26.02?
文章Best Java framework for AI coding: why webforJ fits
文章AI coding in Java: quality control for generated code
文章AI coding assistant for Java: the webforJ AI plugin