JavaFX 现已发布:Applets 和 Java Desktop 正式消亡了吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/377593/
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 12:09:00  来源:igfitidea点击:

JavaFX is now out: Are Applets and Java Desktop officially dead/dying?

javaappletjavafx

提问by thenonhacker

JavaFXis now out, and there are promises that Swing will improve along with JavaFX. Gone will be the days of ugly default UI, and at long last we can create engaging applications that are comparable to Flash, Air, and Silverlightin terms of quality.

JavaFX现已推出,并且有保证 Swing 将与 JavaFX 一起改进。丑陋的默认 UI 的日子将一去不复返,我们终于可以创建在质量方面与Flash、Air 和 Silverlight相媲美的引人入胜的应用程序。

  1. Will this mean that Java Appletsthat hail from 1990's are dead and not worth going back to?

  2. Same with Java Desktop: What will be compelling for us Java Developers to use it rather than JavaFX?

  1. 这是否意味着来自 1990 年代的Java Applet已经过时并且不值得再使用?

  2. Java 桌面相同:什么会吸引我们 Java 开发人员使用它而不是 JavaFX?

采纳答案by JeeBee

In my opinion Java Applets have been dead for years. I wrote some in the late 90s - a Tetris game during an internship to demonstrate on a 40MHz ARM Acorn Set Top Box for example. Of course I bet there are some casual game sites that have tonnes of them still, and thus it will remain supported, but active development will/has dropped off.

在我看来,Java Applet 已经死了很多年了。我在 90 年代后期写了一些 - 例如在实习期间在 40MHz ARM Acorn 机顶盒上演示的俄罗斯方块游戏。当然,我敢打赌,有些休闲游戏网站仍然拥有大量游戏,因此它将继续受到支持,但积极的开发将会/已经下降。

Java Web Start is a handy technology in my opinion. That will still work with JavaFX, it's just another library for that system.

在我看来,Java Web Start 是一种方便的技术。这仍然适用于 JavaFX,它只是该系统的另一个库。

JavaFX will give Java opportunities beyond technical tools (like SQL Developer), in-house business applications and server applications (where it excels). I think it's one of those libraries that is worth learning for any Java developer, if they can get the time. There's no arguing that user interface libraries for Java have been sorely lacking, or overly complex, for many a year.

JavaFX 将为 Java 提供超越技术工具(如 SQL Developer)、内部业务应用程序和服务器应用程序(它擅长的领域)的机会。我认为这是任何 Java 开发人员都值得学习的库之一,如果他们有时间的话。毫无疑问,Java 的用户界面库多年来一直严重缺乏或过于复杂。

However there's a lot of competition out there, and it is very new (which means the development tool support is very raw, compared to Flash and Silverlight). Also people don't like downloading massive runtime environments, although broadband makes it less painful than 5 years ago for many!

然而,那里有很多竞争,而且它非常新(这意味着与 Flash 和 Silverlight 相比,开发工具的支持非常原始)。人们也不喜欢下载大量的运行时环境,尽管宽带让许多人比 5 年前少了痛苦!

回答by Julien Chastang

I think this discussion is somewhat misleading. I an no fan of applet technology either (and I have been underwhelmed by JavaFX). But the point that this thread is missing is that, unless I am mistaken, JavaFX is built on top of applet technology. They are not competing or mutually exclusive. See these articles hereand here.

我认为这个讨论有点误导。我也不喜欢小程序技术(JavaFX 也让我不知所措)。但该线程缺少的一点是,除非我弄错了,JavaFX 是建立在小程序技术之上的。它们不竞争或相互排斥。请在此处此处查看这些文章。

It could be that the confusion is somewhat intentional on Sun's part as they do not want JavaFX and applets to be mentioned in the same sentence, since Applets had so many problems.

可能是 Sun 有意造成混淆,因为他们不希望在同一个句子中提到 JavaFX 和小程序,因为小程序有很多问题。

回答by Patrick Lee

Java Applets are not dead.

Java Applet 并没有消亡。

They had a bad history, for several reasons:

他们有一段糟糕的历史,有几个原因:

  • Most platforms had bad browser plug-ins for the entire 90s, moving into the 2000s, and this gave Applets (and Java, to some extent) a reputation for slowness and large downloads.
  • The actual Applet platform created a new VM for each applet, which further created sluggishness, especially in the startup of an Applet.
  • many Applet developers weren't conscientious about minimizing the size of the jars they pushed down, even Further creating the impression of sluggishness
  • 大多数平台在整个 90 年代都有糟糕的浏览器插件,进入 2000 年代,这让 Applets(和 Java,在某种程度上)以缓慢和大量下载而闻名。
  • 实际的 Applet 平台为每个小程序创建了一个新的 VM,这进一步造成了缓慢,尤其是在 Applet 启动时。
  • 许多 Applet 开发人员并没有认真地将他们推下的 jar 的大小最小化,甚至进一步造成了呆滞的印象

The improvements which bring JavaFX also bring improvements to the Applet (they are one and the same). VMs can be shared and caching is better than before. In addition, higher average user bandwidth can help even poorly designed applet deployments startup quickly. If you look along the axes of install base and platform power, the Applet is still pretty high up, if not the top, in my opinion.

带来 JavaFX 的改进也带来了对 Applet 的改进(它们是一回事)。虚拟机可以共享,缓存也比以前更好。此外,更高的平均用户带宽甚至可以帮助设计不佳的小程序部署快速启动。如果你沿着安装基础和平台能力的轴看,在我看来,Applet 仍然相当高,如果不是顶部的话。

JavaFX is cool, but it requires an additional runtime, and for many parts of it is just syntactic sugar on top of the Applet platform. Almost any problems Applets have today are shared by JavaFX for this reason

JavaFX 很酷,但它需要一个额外的运行时,而且它的许多部分只是 Applet 平台之上的语法糖。由于这个原因,JavaFX 共享了 Applet 今天几乎所有的问题

回答by Domchi

Actually, Java applets are a nice technology which could have been as ubiquitous as Flash, if only Sun didn't lose the PR and technology war with Microsoft.

实际上,Java 小程序是一项很好的技术,如果 Sun 没有输掉与 Microsoft 的公关和技术War,它本来可以像 Flash 一样无处不在。

Microsoft was pushing DirectX controls at a time, and leveraging IE market share against applets. I remember doing some benchmarks then: Java applet of 3 MB (which was large), loaded from local disk (to take network load times out of equation), took around 5 seconds to start in Opera. The same applet somehow took about 2 minutes to start in IE.

微软当时正在推动 DirectX 控件,并利用 IE 市场份额来对抗小程序。我记得当时做了一些基准测试:从本地磁盘加载的 3 MB 的 Java 小程序(很大)(将网络加载时间排除在外),在 Opera 中启动大约需要 5 秒。同一个小程序不知何故在 IE 中启动大约需要 2 分钟。

So, it wasn't that technology sucked; it wasn't that applets were slow because they were too big; they were slow because the dominant browser at the time deliberately made them slow. :)

所以,并不是技术太烂了;并不是因为applet 太大,所以速度慢;它们之所以慢是因为当时的主流浏览器故意让它们变慢。:)

I guess that JavaFX is Sun's attempt to revive a lot of ideas from applets, at a different time and in a different market.

我猜 JavaFX 是 Sun 在不同的时间和不同的市场中尝试从 Applet 中恢复很多想法的尝试。

回答by David Koelle

Java Applets died not because of the concept of an applet, but because the JRE plugin for web browsers was abyssmal.

Java Applet 的消亡不是因为小程序的概念,而是因为 Web 浏览器的 JRE 插件非常糟糕

In fact, Flash proved that there is a role for in-line interactive content.

事实上,Flash 证明了在线互动内容的作用。

JavaFX is a new way of programming rich internet applications - essentially equivalent to Java applets or Flash content. The new JRE runtime (1.6.0_10, aka "Update 10") includes lots of features that make running Java in the context of a browser much more palatable.

JavaFX 是一种新的富 Internet 应用程序编程方式——本质上等同于 Java 小程序或 Flash 内容。新的 JRE 运行时(1.6.0_10,又名“Update 10”)包含许多特性,这些特性使得在浏览器的上下文中运行 Java 变得更加可口。

JavaFX != Java Desktop. The two are quite different, and each have a place in a developer's toolbox.

JavaFX != Java 桌面。两者完全不同,每个都在开发人员的工具箱中占有一席之地。

回答by Learning

Though this might eventually be true , currently JavaFX lacks controls , no mobile devices support and other lacunae which makes it 'not there yet'

虽然这最终可能是真的,但目前 JavaFX 缺乏控制、没有移动设备支持和其他缺陷,这使得它“还没有”

回答by Learning

  1. Will this mean that Java Applets that hail from 1990's are dead and not worth going back to?
  1. 这是否意味着来自 1990 年代的 Java Applet 已经过时并且不值得再使用?

JavaFX and associated changes are an attempt to revitalize the applet space - applets were always dogged by poor plugin implementations and flakeu`y bridges into the browser. That's been improved - though still needs more work - but at last Sun has recognized it needed work and has done something about it. Applets are better positioned than they have ever been. Of the competition you mention - Flash, Air, and Silverlight - I think you missed out the key competitor - the browser/javascript - the browser makers are also addressing key platform weaknesses - javascript performance, ability to do arbitrary drawing ( ie canvas etc ). For low-end requirements I think a pure play browser approach is going to win out - for higher end graphics - JavaFX has a chance.

JavaFX 和相关的更改试图重振小程序空间——小程序总是被糟糕的插件实现和浏览器的flakeu`y 桥所困扰。这已经得到改进——尽管仍然需要更多的工作——但最后 Sun 意识到它需要工作并为此做了一些事情。小程序的位置比以往任何时候都好。在您提到的竞争中 - Flash、Air 和 Silverlight - 我认为您错过了主要竞争对手 - 浏览器/javascript - 浏览器制造商也在解决关键平台弱点 - javascript 性能、进行任意绘图(即画布等)的能力. 对于低端需求,我认为纯浏览器方法会胜出——对于高端图形——JavaFX 有机会。

  1. Same with Java Desktop: What will be compelling for us Java Developers to use it rather than JavaFX?
  1. 与 Java 桌面相同:什么会吸引我们 Java 开发人员使用它而不是 JavaFX?

As a big developer of Java Desktop apps, one of the things that's missing is a decent set of basic widgets and the time to play! It needs a killer table implementation - you can embedded swing but kinda what's the point. Now I could write my own by that's not really where I'm adding value in my kinda of job.

作为 Java 桌面应用程序的大型开发人员,缺少的一件事是一组不错的基本小部件和玩游戏的时间!它需要一个杀手级的表实现——你可以嵌入摇摆但有点什么意义。现在我可以写我自己的,这并不是我在我的工作中增加价值的地方。

回答by Mark Wilcox

1 - Will this mean that Java Applets that hail from 1990's are dead and not worth going back to?With the update to the Java plug-in - all applets, not just JavaFX-based applets get the improved user experience and performance. That being said - I don't think there are many (if any) killer applets out there. If there were - JavaFX would never have been needed.

1 - 这是否意味着来自 1990 年代的 Java Applet 已经过时并且不值得再使用?随着对 Java 插件的更新 - 所有小程序,而不仅仅是基于 JavaFX 的小程序都获得了改进的用户体验和性能。话虽如此 - 我认为那里没有很多(如果有的话)杀手级小程序。如果有的话 - 永远不需要 JavaFX。

2 - Same with Java Desktop: What will be compelling for us Java Developers to use it rather than JavaFX?If you are building GUI applications and want to run it in Java - in particular across multiple platforms (e.g. desktop, applets and mobile) as well as make it easier to work with someone who has actual Photoshop/GIMP skills - JavaFX is your best choice because it was designed explicitly for that type of process. However, remember JavaFX can call Java code and it can also make remote calls (either getting back XML or JSON). I think the most likely integration point will be to use JavaFX for UI and caching of results but all of the heavy coding logic will be on the server. Where it can be written in Java or .NET or assembler if you can get your assembler to emit XML or JSON :).

2 - 与 Java 桌面相同:什么会吸引我们 Java 开发人员使用它而不是 JavaFX?如果您正在构建 GUI 应用程序并希望在 Java 中运行它 - 特别是跨多个平台(例如桌面、小程序和移动设备)以及更容易与具有实际 Photoshop/GIMP 技能的人一起工作 - JavaFX 是您的最佳选择因为它是为这种类型的过程明确设计的。但是,请记住 JavaFX 可以调用 Java 代码,也可以进行远程调用(返回 XML 或 JSON)。我认为最有可能的集成点是将 JavaFX 用于 UI 和结果缓存,但所有繁重的编码逻辑都将在服务器上。如果您可以让您的汇编器发出 XML 或 JSON,那么它可以用 Java 或 .NET 或汇编器编写的地方:)。

回答by Mark Wilcox

We cannot easily write applets down as there are way too many good code on a web. Lots of it was written by people who are not specialists in software development but are specialists in various high end areas that they tried to explain and illustrate with the help of Java applets, the top technology at that time. They may not have time to learn new language and rewrite they work any. Many are not active for years.

我们不能轻易地写下小程序,因为网络上有太多好的代码。其中很多是由不是软件开发专家而是各种高端领域专家的人编写的,他们试图在当时的顶级技术 Java 小程序的帮助下进行解释和说明。他们可能没有时间学习新语言并重写他们的任何工作。许多人多年不活跃。

I also see Java applets as more appropriate for community projects that are based on server side builds and code reviewing. Various fancy user friendly tools can make development of web components fast and easy but the result is either not human readable at all or very difficult to review.

我还认为 Java 小程序更适合基于服务器端构建和代码的社区项目。各种花哨的用户友好工具可以使 Web 组件的开发变得快速而简单,但结果要么根本不可读,要么很难。

We have recently launched the Ultrastudio.orgproject that still relies on Java applet technology. I was thinking a lot about putting more languages and platforms but at the end was forced to conclude that it is either less secure or otherwise way more complex to do.

我们最近启动了仍然依赖 Java 小程序技术的Ultrastudio.org项目。我想了很多关于放置更多语言和平台的问题,但最后被迫得出结论,要么不太安全,要么做起来更复杂。

回答by Brian Knoblauch

I agree with the others, Java Applets already died. JavaFX could possibly fill that void. However, I just don't see it replacing Java Desktop any time soon. It's the same thing as saying web apps will replace all desktop apps. Some people do believe that, and I agree that web apps will grow in popularity, however, desktop apps will continue to have a place for quite awhile.

我同意其他人的看法,Java Applets 已经死了。JavaFX 可能会填补这一空白。但是,我认为它不会很快取代 Java Desktop。这与说网络应用程序将取代所有桌面应用程序是一样的。有些人确实相信这一点,我也同意 Web 应用程序会越来越受欢迎,但是,桌面应用程序将在相当长的一段时间内继续占有一席之地。