执行 Swing 应用程序的更好方法

发布于 2024-07-09 22:46:07 字数 85 浏览 4 评论 0原文

有没有更好的方法来开发 Java Swing 应用程序?

SWIXML? JavaFX? 这里的开发人员还有什么喜欢和推荐的吗?

Is there a better way to develop Java Swing applications?

SWIXML? JavaFX? Anything else that developers out here have liked and recommend?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

谁许谁一生繁华 2024-07-16 22:46:08

另一个“更好的方法”是通过使用更好的布局管理器:

MigLayout
一个极其灵活且易于使用的布局管理器,适用于 Swing 和 SWT。
它可以通过简单易懂的字符串和/或基于 API 的编码来完成表布局、表单布局和几乎所有 Swing 布局管理器可以完成的工作。
它的目标是用于手动编码的布局,就像 Matisse/Group Layout 用于 IDE 一样。

JPanel panel = new JPanel(new MigLayout());

panel.add(firstNameLabel);
panel.add(firstNameTextField);
panel.add(lastNameLabel,       "gap unrelated");
panel.add(lastNameTextField,   "wrap");
panel.add(addressLabel);
panel.add(addressTextField,    "span, grow");

替代文本
(来源:miglayout.com

Another "better way" is through the use of a better Layout Manager:

MigLayout:
an extremely flexible and easy to use Layout Manager that works for both Swing and SWT.
It can do what Table Layout, Form Layout and almost all Swing Layout Managers can with simple to understand String and/or API based coding.
It is targeted to be for manually coded layouts what Matisse/Group Layout is for IDEs.

JPanel panel = new JPanel(new MigLayout());

panel.add(firstNameLabel);
panel.add(firstNameTextField);
panel.add(lastNameLabel,       "gap unrelated");
panel.add(lastNameTextField,   "wrap");
panel.add(addressLabel);
panel.add(addressTextField,    "span, grow");

alt text
(source: miglayout.com)

秋凉 2024-07-16 22:46:08

JavaDesktop 是此类问题的非常完整的信息来源。

最近,我发现(但我自己没有直接使用它)Flamingo swing 组件套件令人印象深刻。
特别是因为它允许集成最新的 UI 设计:功能区

(它不是从某种意义上说,这是一种新的开发方式,它仍然是一个经典的 Swing 组件,而不是(例如)基于 XML 的 swing 规范,但我会看看其他 javadestop 项目,以获取您问题的其他说明)

替代文字

JavaDesktop is a very complete source of information for this kind of question.

Lately, I found (but not used it directly myself) the Flamingo swing component suite impressive.
Especially because it allow to integrate one latest recent UI design: ribbons

(It is not a new way to develop in the sense it is still a classic Swing component, not - for instance - an XML-based swing specification, but I would look at other projects of javadestop for other illustrations to your question)

alt text

弥繁 2024-07-16 22:46:08

我喜欢使用 Groovy 构建 UI(HTML、SWT 或 Swing)。 使用 Groovy 构建器 就简单多了。

I like to build the UI (HTML, SWT or Swing) with Groovy. It's just so much more simple with Groovy builders.

芯好空 2024-07-16 22:46:08

如果您喜欢使用 Groovy 而不是 Java 进行编程,请查看 Griffon:http://griffon.codehaus.org/

If you like programming in Groovy instead of Java, check out Griffon: http://griffon.codehaus.org/

看海 2024-07-16 22:46:08

Swing 应用程序框架是一个轻量级框架,可以简化中小型应用程序的创建和维护Java 桌面应用程序。 该框架由一个 Java 类库组成,该类库支持以下内容的构造:

  • 记住会话之间的状态。
  • 更轻松地管理操作,包括作为后台任务运行和指定阻止行为。
  • 增强的资源管理,包括 bean 属性的资源注入。

这是一篇关于它的文章

它已与 Netbeans 6.0 及更高版本集成。

The Swing Application Framework is a light framework that simplifies the creation and maintaining of small- to medium-sized Java desktop applications. The framework consists of a Java class library that supports constructs for things such as the following:

  • Remembering state between sessions.
  • Easier managing of actions, including running as background tasks and specifying blocking behavior.
  • Enhanced resource management, including resource injection for bean properties.

Here's an article about it.

It's been integrated with Netbeans 6.0 and later.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文