Java 中的高级 GUI 可能吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/816020/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 13:54:39  来源:igfitidea点击:

Advanced GUI Possible in Java?

javauser-interface

提问by derick van

Perhaps a philosophical question. I've seen some interesting visuals lately in GUIs, mostly on native platform APIs. I know that “it's just software” and that likely, with enough work, anything can be done with pixels. The question is (finally!), is Java really an option for doing fancy things with a GUI. Seems like a silly thing I guess, but I kind of like some of the Windows Presentation Foundation work. I don't see a consolidated effort like this for Java. Where should I look?

也许是哲学问题。我最近在 GUI 中看到了一些有趣的视觉效果,主要是在本机平台 API 上。我知道“它只是软件”,而且很可能,只要有足够的工作,像素就可以完成任何事情。问题是(终于!),Java 是否真的是使用 GUI 做奇特事情的一种选择。我猜这似乎是一件愚蠢的事情,但我有点喜欢 Windows Presentation Foundation 的一些工作。我没有看到像这样的针对 Java 的综合努力。我应该在哪里看?

回答by JRL

Take a look at JavaFX.

看看JavaFX

回答by coobird

There has been some advancements in the GUI front in Java.

Java 在 GUI 方面取得了一些进步。

For example, beginning from Java 6 Update 10, it is possible to make transparent and shaped windows (i.e. arbitrarily-shaped windows commonly seen in media players) in Java:

例如,从 Java 6 Update 10 开始,可以在 Java 中制作透明和形状的窗口(即媒体播放器中常见的任意形状的窗口):

How to Create Translucent and Shaped Windows

如何创建半透明和异形窗户

Filthy Rich Clients: Developing Animated and Graphical Effects for Desktop Java Applicationsby Chet Haase and Romain Guy is a good book full of tips on making advanced GUIs in Swing.

Filthy Rich Clients: Development Animated and Graphical Effects for Desktop Java Applicationsby Chet Haase 和 Romain Guy 是一本好书,其中包含在 Swing 中制作高级 GUI 的技巧。

回答by Matthew Flaschen

If you like a powerful GUI and don't mind it not being entirely Java-y, obviously check out the Standard Widget Toolkit(the window toolset behind eclipse).

如果您喜欢功能强大的 GUI 并且不介意它不完全是 Java y,那么显然可以查看Standard Widget Toolkit(eclipse 背后的窗口工具集)。

回答by Dave Ray

The book Filthy Rich Clientscovers many advanced rendering and animation techniques in Swing and Java2d. It may be worth a look if JavaFXis not an option.

Filthy Rich Clients一书涵盖了 Swing 和 Java2d 中的许多高级渲染和动画技术。如果JavaFX不是一个选项,可能值得一看。

回答by Scott Evernden

'Consolidated' and 'Java' usually don't go together, But aside from that there is Pivot, Thinlet, Swing, and SWT.. and many others . So I think the answer is: Yes there are.

'Consolidated' 和 'Java' 通常不会放在一起,但除此之外,还有PivotThinletSwingSWT.. 等等。所以我认为答案是:是的。

回答by alphazero

The only limitations for Java (on some platforms) is the seamless integration between the JVM and the host OS ui frameworks (think drag drop, etc.).

Java(在某些平台上)的唯一限制是 JVM 和主机操作系统 ui 框架(想想拖放等)之间的无缝集成。

Beyond that, what is it that you want to do that you think Java will not be able to handle?

除此之外,还有什么是您认为 Java 无法处理的?

https://appframework.dev.java.net/

https://appframework.dev.java.net/

回答by Yishai

Having done major Swing development in Java, I would say that if Windows only is what you want, I would think very hard about what advantage Java gives you over .NET to make it worth the hastle. Yes, ultimately you can get it done. There is some great software out there that shows it can be done. It is not easy. At all.

在用 Java 完成了主要的 Swing 开发之后,我会说,如果您只想要 Windows,那么我会非常认真地思考 Java 为您提供的相对于 .NET 的优势,让您值得为之努力。是的,最终你可以完成它。有一些很棒的软件表明它可以做到。这不简单。在所有。

But if you want to do Windows GUI development, at the end of the day Java will just get in your way. Want to interact with a Windows service (like Desktop Search, just to pick an example)? Very hard to do.

但是,如果您想进行 Windows GUI 开发,那么 Java 最终会成为您的障碍。想要与 Windows 服务交互(比如桌面搜索,只是举个例子)?很难做到。

On the other hand, if you need your software to be platform independent, that is a completely different ballgame.

另一方面,如果您需要软件独立于平台,那就是完全不同的游戏了。

JavaFX is very promising, but it is very new. Many of the things that you kind of expect to be there, just aren't yet, for the boring business applications anyway. If you are writing a game, that is a little different.

JavaFX 很有前途,但它很新。无论如何,对于无聊的业务应用程序,您期望的许多东西都还没有出现。如果您正在编写游戏,那就有点不同了。