Swing组件是轻量?

编程入门 行业动态 更新时间:2024-10-12 03:17:35
本文介绍了Swing组件是轻量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

每当我读到左右摇摆,他们说他们是重量轻的分量。所以,我只是一派摇摆,发现它意味着摇摆不依赖于本地同级。这就是为什么它们被称为轻?我的意思是重量轻,我想也许Swing组件占据比AWT组件更少的内存。难道不是这样的吗?

Whenever I read about Swing they say they are light weight components. So I just googled Swing and found that it means Swing does not depend on native peers. Is that why they are called "light weight"? I mean by light weight I thought maybe the Swing components occupy less memory than the AWT components. Isn't that so?

推荐答案

摆动被认为是轻量级因为它是在Java中全面实施,而不调用本地操作系统绘制的图形用户界面组件。

Swing is considered lightweight because it is fully implemented in Java, without calling the native operating system for drawing the graphical user interface components.

在另一方面, AWT 的(抽象窗口工具包)是重量级的工具包,因为它仅仅是使该操作呼叫系统,以便产生其GUI组件。

On the other hand, AWT (Abstract Window Toolkit) is heavyweight toolkit, as it merely makes calls to the operating system in order to produce its GUI components.

借助​​ Swing的涂装系统从的部分的演变= java.sun/products/jfc/tsc/articles/painting/\">Painting在AWT和Swing 文章解释了轻量级和重量级的区别是:

The Evolution of the Swing Paint System section from the Painting in AWT and Swing article explains the difference between lightweight and heavyweight:

在原来的AWT API是  只为JDK 1.0开发的,  存在的重量级组件  (重量级意味着该  组件都有它自己的本地不透明  窗口)。这使得AWT依赖  大量在每个涂料子系统  本地平台。

When the original AWT API was developed for JDK 1.0, only heavyweight components existed ("heavyweight" means that the component has it's own opaque native window). This allowed the AWT to rely heavily on the paint subsystem in each native platform.

[...]

使用  引进轻量级  在JDK 1.1的组件(轻量级  组件是一个重用  其最接近的本地窗口  重量级祖先),则需要AWT  落实漆处理  在共享的轻量级组件  Java的code。

With the introduction of lightweight components in JDK 1.1 (a "lightweight" component is one that reuses the native window of its closest heavyweight ancestor), the AWT needed to implement the paint processing for lightweight components in the shared Java code.

从Swing在Java中实现的,它确实有一些性能上处于劣势,但是,我听说业绩最新的Java的排放有所改善。

As Swing is implemented in Java, it does have some performance disadvantage, however, I hear that performance has improved in recent releases of Java.

摆动的优点是,它有许多可用的多种组分如 的JTable 和 JList的 这是比AWT提供的组件更图形化和可扩展性,允许更多的图形丰富的应用程序被开发。

The advantage of Swing is that it has many more components available such as JTable and JList which are more graphical and extensible than the components provided in AWT, allowing for more graphics-rich applications to be developed.

更多推荐

Swing组件是轻量?

本文发布于:2023-11-25 10:58:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629479.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:组件   Swing   是轻量

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!