有人可以推荐 Java swing 的替代品吗?

发布于 2024-10-07 14:33:21 字数 126 浏览 4 评论 0原文

我最近一直在研究 Java swing,但它实在是太丑了!大多数编写 Java GUI 的人都是使用 swing 还是其他东西?我真的很感激你的推荐。我不想使用 GUI 构建器,因为我需要首先了解一切是如何工作的。

谢谢!

I have been mucking about with Java swing lately but it's butt ugly! Are most people who write Java GUI's using swing or something else? I would really appreciate a recommendation. I don't want to use a GUI builder because I need to learn how everything works first.

Thanks!

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

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

发布评论

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

评论(8

才能让你更想念 2024-10-14 14:33:21

如果您不喜欢默认的 Swing 外观,您可以更改它;存在许多现成的主题。使用 Swing 构建美观且符合人体工程学的应用程序是完全可能的:看看 Netbeans 或 IntelliJ。

但如果您确实想使用其他图形工具包,则可以尝试 SWT。与纯 Java 的 Swing 不同,SWT 尽可能多地使用本机控件(由操作系统提供的控件),并模拟缺少的控件。它是为 Eclipse 平台开发并由 Eclipse 平台使用的。

If you don't like the default Swing look'n'feel, you can change it ; many ready-built themes exist. And it is quite possible to build beautiful and ergonomic applications with Swing : take a look at Netbeans or IntelliJ.

But if you definitely want to use another graphic toolkit, you can try SWT. Contrary to Swing that is pure Java, SWT uses native controls as much as possible (those provided by your OS), and emulates the missing ones. It was developed for, and is used by, the Eclipse platform.

贪了杯 2024-10-14 14:33:21

大多数人使用 Swing。

有些使用 SWT,但使用后必须处置对象。 (垃圾收集中没有自动处置)它提供了非常原生的 UI。

有些使用 Qt-Jambi,但你必须了解一些 C++ 代码。其中大部分是为了与Qt互操作。

一些古老的代码使用 AWT。其中大多数是出于遗留原因。我建议避免它。

Most people use Swing.

Some use SWT, but you have to dispose object after use. (no auto dispose in Garbage collecting) It give very native look UI.

Some use Qt-Jambi, but then you have to understand some C++ code. Most of them are for interoperating with Qt.

Some ancient code use AWT. Most of them are for legacy reason. I recommend avoid it.

别靠近我心 2024-10-14 14:33:21

我最近一直在研究 Java swing,但它实在是太丑了!

try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {}

大多数人都使用 swing 编写 Java GUI

对于大多数事情来说,是的。它是内置的,对于跨平台 GUI 库来说并没有那么糟糕(这在某种程度上都很糟糕)。

I have been mucking about with Java swing lately but it's butt ugly!

try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {}

Are most people who write Java GUI's using swing

For most things, yes. It's built-in, and doesn't suck that bad for a cross-platform GUI library (which all suck to some extent).

安静 2024-10-14 14:33:21

顺便说一下,Swing 的外观和感觉是可以定制的。有一些非常好的 LaF。 查看此处如何更改外观。

检查这个问题,了解如何更改外观和感觉以及良好外观和感觉的列表

By the way, Swing's Look and Feel can be customized. There are some pretty good LaFs. See here how to change the look and feel.

Check this question for how to change the look and feel and for a list of nice look and feels

黑白记忆 2024-10-14 14:33:21

SWT 非常好。它尝试尽可能使用本机 GUI 绘图功能。使用 SWT 编写的应用程序的一个示例是 Eclipse IDE。

http://www.eclipse.org/swt/

SWT is very good. It tries to use native GUI drawing functions wherever possible. An example of application written with SWT is Eclipse IDE.

http://www.eclipse.org/swt/

酒解孤独 2024-10-14 14:33:21

您可以在 swing 中使用本机外观和感觉,因此它不那么难看。就我个人而言,我在 java 中使用 swing 作为 GUI,并且我发现它非常简单并且有文档记录。

以下是 swing 文档的链接:

http://download.oracle.com /javase/tutorial/uiswing/lookandfeel/plaf.html

you can use native look and feel with swing, thus it's less ugly. Personnally, I use swing for my GUIs in java, and I find it quite straight forward and documented.

Here is a link toward swing documentation:

http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

裸钻 2024-10-14 14:33:21

Swing 中唯一丑陋的是标准布局管理。它们要么太原始,要么太复杂。
如果你真的想在没有 gui 构建器的情况下编写漂亮的 gui,请查看替代布局管理器。例如表格布局 https://tablelayout.dev.java.net/

The only thing is ugly in Swing is standart layout manages. They are or too primitive or too complicated.
If you really want to write nice gui without gui builders take a look at alternative layout managers. For example Table layout https://tablelayout.dev.java.net/

郁金香雨 2024-10-14 14:33:21

查看 SWT http://www.eclipse.org/swt/ - Eclipse 完全构建于其之上。

Look to SWT http://www.eclipse.org/swt/ - Eclipse entirely built on it.

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