小程序和 SWING 之间有什么区别?

发布于 2024-08-14 20:48:26 字数 26 浏览 7 评论 0原文

小程序和 SWING 之间有什么区别?

What is the difference between applets and SWING?

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

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

发布评论

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

评论(7

狠疯拽 2024-08-21 20:48:26

请参阅Applet

小程序是用以下语言编写的程序
Java 编程语言可以是
包含在 HTML 页面中,大部分在
同样的方式将图像包含在
页。当你使用Java时
支持技术的浏览器查看
包含小程序的页面,
小程序的代码已传输到您的
系统并由浏览器执行
Java 虚拟机 (JVM)。

请参阅Swing (Java)

Swing 是一个 Java 的小部件工具包。它
是 Sun Microsystems 的 Java 的一部分
基础类 (JFC) — 一个 API
提供图形用户界面
(GUI) 用于 Java 程序。

Swing 的开发是为了提供更多
复杂的 GUI 组件集
比早期的抽象窗口
工具包。 Swing 提供原生外观
并感觉模仿外观和
几个平台的感觉,也
支持可插拔的外观和感觉
允许应用程序有一个
外观和感觉与
底层平台。

See Applets

An applet is a program written in the
Java programming language that can be
included in an HTML page, much in the
same way an image is included in a
page. When you use a Java
technology-enabled browser to view a
page that contains an applet, the
applet's code is transferred to your
system and executed by the browser's
Java Virtual Machine (JVM).

See Swing (Java)

Swing is a widget toolkit for Java. It
is part of Sun Microsystems' Java
Foundation Classes (JFC) — an API for
providing a graphical user interface
(GUI) for Java programs.

Swing was developed to provide a more
sophisticated set of GUI components
than the earlier Abstract Window
Toolkit. Swing provides a native look
and feel that emulates the look and
feel of several platforms, and also
supports a pluggable look and feel
that allows applications to have a
look and feel unrelated to the
underlying platform.

究竟谁懂我的在乎 2024-08-21 20:48:26

小程序是通常在网络浏览器 Java 插件中运行的小程序。

秋千是一种游乐场设备,通常由用两条链条或绳索悬挂的座椅组成。非常有趣。 :)

不过,严肃地说,Swing 是一个 Java GUI 库。它提供了按钮和文本字段等组件。您可以在小程序中使用 Swing 组件。

An applet is a small program that often runs in a web browser Java plugin.

A swing is a piece of playground equipment usually consisting of a seat suspended by two chains or ropes. It's quite fun. :)

In all seriousness, though, Swing is a Java GUI library. It provides components such as buttons and text fields. You can use Swing components in an applet.

贪恋 2024-08-21 20:48:26

Applet 将在客户端 Web 浏览器中下载并在本地执行,其中 swing 具有一组用于开发 GUI 组件的 API,并且可以充当独立的应用程序。

Applets will be downloaded at the client web browser and executed locally where as swing has a set of APIs for developing GUI components and can act as stand alone applications.

向日葵 2024-08-21 20:48:26

简短回答:Applet 旨在成为在网络浏览器中运行并按需下载的小功能。 Swing 是用户界面组件的集合,例如文本框和窗口,旨在由开发人员组装以在桌面上使用。

长答案:参见 adamantium 的答案。

Short answer: Applets are intended to be small bits of functionality run in a web browser and downloaded on-demand. Swing is a collection of user interface components, like text boxes and windows, that are meant to be assembled by a developer for use on the desktop.

Long answer: See adamantium's answer.

风吹过旳痕迹 2024-08-21 20:48:26

我认为令人困惑的是您在构建小程序时最初遇到的所有术语。

Applet 是在 Web 浏览器的 Java 沙箱中运行的程序的总称。它也是一个特定的 Java 类 (java.applet.小程序)。该程序的入口类必须继承Applet。

Applet 最初(Java 1.1 版之前)只能使用 AWT 用户界面组件。

从 Java 版本 1.3 开始,可以改用 Swing 组件。在这种情况下,您的入口类必须扩展 JApplet

I think the confusion is with all the terminology you initially encounter when building applets.

Applet is the overall name for a programme that runs in a Java sandbox in a web browser. It is also a specific Java class (java.applet.Applet). The entry class of this programme must extend Applet.

Applets originally (upto Java version 1.1) could only use AWT user interface components.

Since Java version 1.3 Swing components may be used instead. In this case your entry class must extend JApplet.

贵在坚持 2024-08-21 20:48:26

摇摆 :-
Swing是轻量级组件。
Swing 有它自己的布局,就像最流行的盒子布局一样。
Swing 有一些线程规则。

Applet :-

Applet 是重量级组件。
Applet 使用类似 flowlayout 的 AWT 布局。
Applet 没有任何规则。

Swing :-
Swing is light weight component .
Swing have it's own layout like most popular box layout.
Swing have some thread rules.

Applet :-

Applet is heavy weight component.
Applet uses AWT layout like flowlayout.
Applet doesn't have any rules.

南城旧梦 2024-08-21 20:48:26
  1. Swing 是轻量级组件。
    Applet 是重量级组件。

  2. Swing 具有根据用户视图的外观和感觉,您可以使用 UIManager 更改外观和感觉。
    Applet 不提供此功能。

  3. Swing 用于独立应用程序,Swing 有 main 方法来执行程序。
    Applet 需要 HTML 代码来运行 Applet。

  4. Swing 使用 MVC 模型视图控制器。
    Applet 没有。

  5. Swing 有自己的布局,就像最流行的 Box 布局一样。
    Applet 使用 AWT 布局(如 flowlayout)。

  6. Swing 有一些线程规则。
    Applet 没有任何规则。

  7. Swing:-执行 Swing 不需要任何浏览器,我们可以通过它创建独立的应用程序,但是在这里我们必须添加容器并在框架容器中维护所有操作控制。


Applet:要执行Applet程序,我们需要任何浏览器,例如AppletViewer(Web浏览器)。因为Applet是使用浏览器容器来运行的,所有的动作控制都是在浏览器容器中进行的。

  1. Swing is light weight Component.
    Applet is heavy weight Component.

  2. Swing have look and feel according to user view you can change look and feel using UIManager.
    Applet Does not provide this facility.

  3. Swing uses for stand lone Applications, Swing have main method to execute the program.
    Applet need HTML code for Run the Applet.

  4. Swing uses MVC Model view Controller.
    Applet not.

  5. Swing have its own Layout like most popular Box Layout.
    Applet uses AWT Layouts like flowlayout.

  6. Swing have some Thread rules.
    Applet doesn't have any rule.

  7. Swing:-To execute Swing no need any browser By which we can create stand alone application But Here we have to add container and maintain all action control with in frame container.


Applet: to execute Applet program we should need any browser like AppletViewer, a web browser. Because Applet is using browser container to run and all action control with in browser container.

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