Swing组件是轻量? [英] Swing components are light-weight?

查看:136
本文介绍了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的涂装系统从的部分的演变= http://java.sun.com/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组件是轻量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆