问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

java中heavyweight与lightweight的区别

发布网友 发布时间:2022-04-25 08:00

我来回答

2个回答

热心网友 时间:2023-11-07 21:04

看得懂英文就看英文吧
我就往通俗里说吧。
所谓重量级组件轻量级组件是相对的。
重量级组件就是说要完全依赖于这个组件才能实现 的。
轻量级组件就是说可以脱离此组件,基本不用修改核心代码就能实现的。
比如EJB就是个重量级组件。做成的一个EJB项目,如果要改成SSH做的话,基本就要重新做了。
比如Struts2就是个轻量级组件。要写个struts2的helloworld就写个普通类加配置一下就OK了,将来不用struts2了,那OK,把配置删掉,再写一个类去配置。核心代码基本不用动。
这基本就是其中的区别

热心网友 时间:2023-11-07 21:05

看得懂英文就看英文吧
我就往通俗里说吧。
所谓重量级组件轻量级组件是相对的。
重量级组件就是说要完全依赖于这个组件才能实现 的。
轻量级组件就是说可以脱离此组件,基本不用修改核心代码就能实现的。
比如EJB就是个重量级组件。做成的一个EJB项目,如果要改成SSH做的话,基本就要重新做了。
比如Struts2就是个轻量级组件。要写个struts2的helloworld就写个普通类加配置一下就OK了,将来不用struts2了,那OK,把配置删掉,再写一个类去配置。核心代码基本不用动。
这基本就是其中的区别

热心网友 时间:2023-11-07 21:05

看得懂英文就看英文吧
我就往通俗里说吧。
所谓重量级组件轻量级组件是相对的。
重量级组件就是说要完全依赖于这个组件才能实现 的。
轻量级组件就是说可以脱离此组件,基本不用修改核心代码就能实现的。
比如EJB就是个重量级组件。做成的一个EJB项目,如果要改成SSH做的话,基本就要重新做了。
比如Struts2就是个轻量级组件。要写个struts2的helloworld就写个普通类加配置一下就OK了,将来不用struts2了,那OK,把配置删掉,再写一个类去配置。核心代码基本不用动。
这基本就是其中的区别

热心网友 时间:2023-11-07 21:05

根据sun官方所说:
A heavyweight component is one that is associated with its own native screen resource (commonly known as a peer). A lightweight component is one that "borrows" the screen resource of an ancestor (which means it has no native resource of its own -- so it's "lighter").

(大意是:重量级组件需要一个本地屏幕资源 轻量级组件不需要)
轻量级组件的优势:
* You want to create a custom component that isn't rectangular.
* You want to create a custom component that's partly (or entirely) transparent.
* You want to use multiple components that can draw in each others' areas.
* Your program contains many components and would be too inefficient if implemented with heavyweight components.

*可以创建非规则组件
*可以创建半透明或者全透明组件
*可以层叠摆放
*比重量级组件更高效

继续引用Sun官方文献:
To create a lightweight component, you need to create a class that directly extends one of the following classes:

* Component
* Container
* a class that implements a lightweight component -- for example, a non-AWT class that is a subclass of Component or Container

轻量级组件是java.awt.Component java.awt.Container的子类
(所以Swing组件都是轻量级组件)

参考资料:http://java.sun.com/j2se/1.4.2/docs/guide/awt/demos/lightweight/index.html

热心网友 时间:2023-11-07 21:05

根据sun官方所说:
A heavyweight component is one that is associated with its own native screen resource (commonly known as a peer). A lightweight component is one that "borrows" the screen resource of an ancestor (which means it has no native resource of its own -- so it's "lighter").

(大意是:重量级组件需要一个本地屏幕资源 轻量级组件不需要)
轻量级组件的优势:
* You want to create a custom component that isn't rectangular.
* You want to create a custom component that's partly (or entirely) transparent.
* You want to use multiple components that can draw in each others' areas.
* Your program contains many components and would be too inefficient if implemented with heavyweight components.

*可以创建非规则组件
*可以创建半透明或者全透明组件
*可以层叠摆放
*比重量级组件更高效

继续引用Sun官方文献:
To create a lightweight component, you need to create a class that directly extends one of the following classes:

* Component
* Container
* a class that implements a lightweight component -- for example, a non-AWT class that is a subclass of Component or Container

轻量级组件是java.awt.Component java.awt.Container的子类
(所以Swing组件都是轻量级组件)

参考资料:http://java.sun.com/j2se/1.4.2/docs/guide/awt/demos/lightweight/index.html

热心网友 时间:2023-11-07 21:05

看得懂英文就看英文吧
我就往通俗里说吧。
所谓重量级组件轻量级组件是相对的。
重量级组件就是说要完全依赖于这个组件才能实现 的。
轻量级组件就是说可以脱离此组件,基本不用修改核心代码就能实现的。
比如EJB就是个重量级组件。做成的一个EJB项目,如果要改成SSH做的话,基本就要重新做了。
比如Struts2就是个轻量级组件。要写个struts2的helloworld就写个普通类加配置一下就OK了,将来不用struts2了,那OK,把配置删掉,再写一个类去配置。核心代码基本不用动。
这基本就是其中的区别

热心网友 时间:2023-11-07 21:05

根据sun官方所说:
A heavyweight component is one that is associated with its own native screen resource (commonly known as a peer). A lightweight component is one that "borrows" the screen resource of an ancestor (which means it has no native resource of its own -- so it's "lighter").

(大意是:重量级组件需要一个本地屏幕资源 轻量级组件不需要)
轻量级组件的优势:
* You want to create a custom component that isn't rectangular.
* You want to create a custom component that's partly (or entirely) transparent.
* You want to use multiple components that can draw in each others' areas.
* Your program contains many components and would be too inefficient if implemented with heavyweight components.

*可以创建非规则组件
*可以创建半透明或者全透明组件
*可以层叠摆放
*比重量级组件更高效

继续引用Sun官方文献:
To create a lightweight component, you need to create a class that directly extends one of the following classes:

* Component
* Container
* a class that implements a lightweight component -- for example, a non-AWT class that is a subclass of Component or Container

轻量级组件是java.awt.Component java.awt.Container的子类
(所以Swing组件都是轻量级组件)

参考资料:http://java.sun.com/j2se/1.4.2/docs/guide/awt/demos/lightweight/index.html

热心网友 时间:2023-11-07 21:05

看得懂英文就看英文吧
我就往通俗里说吧。
所谓重量级组件轻量级组件是相对的。
重量级组件就是说要完全依赖于这个组件才能实现 的。
轻量级组件就是说可以脱离此组件,基本不用修改核心代码就能实现的。
比如EJB就是个重量级组件。做成的一个EJB项目,如果要改成SSH做的话,基本就要重新做了。
比如Struts2就是个轻量级组件。要写个struts2的helloworld就写个普通类加配置一下就OK了,将来不用struts2了,那OK,把配置删掉,再写一个类去配置。核心代码基本不用动。
这基本就是其中的区别

热心网友 时间:2023-11-07 21:05

根据sun官方所说:
A heavyweight component is one that is associated with its own native screen resource (commonly known as a peer). A lightweight component is one that "borrows" the screen resource of an ancestor (which means it has no native resource of its own -- so it's "lighter").

(大意是:重量级组件需要一个本地屏幕资源 轻量级组件不需要)
轻量级组件的优势:
* You want to create a custom component that isn't rectangular.
* You want to create a custom component that's partly (or entirely) transparent.
* You want to use multiple components that can draw in each others' areas.
* Your program contains many components and would be too inefficient if implemented with heavyweight components.

*可以创建非规则组件
*可以创建半透明或者全透明组件
*可以层叠摆放
*比重量级组件更高效

继续引用Sun官方文献:
To create a lightweight component, you need to create a class that directly extends one of the following classes:

* Component
* Container
* a class that implements a lightweight component -- for example, a non-AWT class that is a subclass of Component or Container

轻量级组件是java.awt.Component java.awt.Container的子类
(所以Swing组件都是轻量级组件)

参考资料:http://java.sun.com/j2se/1.4.2/docs/guide/awt/demos/lightweight/index.html

热心网友 时间:2023-11-07 21:05

根据sun官方所说:
A heavyweight component is one that is associated with its own native screen resource (commonly known as a peer). A lightweight component is one that "borrows" the screen resource of an ancestor (which means it has no native resource of its own -- so it's "lighter").

(大意是:重量级组件需要一个本地屏幕资源 轻量级组件不需要)
轻量级组件的优势:
* You want to create a custom component that isn't rectangular.
* You want to create a custom component that's partly (or entirely) transparent.
* You want to use multiple components that can draw in each others' areas.
* Your program contains many components and would be too inefficient if implemented with heavyweight components.

*可以创建非规则组件
*可以创建半透明或者全透明组件
*可以层叠摆放
*比重量级组件更高效

继续引用Sun官方文献:
To create a lightweight component, you need to create a class that directly extends one of the following classes:

* Component
* Container
* a class that implements a lightweight component -- for example, a non-AWT class that is a subclass of Component or Container

轻量级组件是java.awt.Component java.awt.Container的子类
(所以Swing组件都是轻量级组件)

参考资料:http://java.sun.com/j2se/1.4.2/docs/guide/awt/demos/lightweight/index.html

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
乱字同韵字是什么意思 华硕笔记本电脑触摸板怎么开笔记本电脑触摸板怎么开启和关闭_百度知 ... 陕西职务侵占案立案准则 结婚后我的恋情维系了十年,怎么做到的? 玉米仁子饭产自哪里 中国期货交易所的交易品种有哪些? 历史要怎么读,有啥诀窍 高中历史诀窍 年终会活动策划方案 深度解析:第一财经回放,探索财经新风向 求小野丽沙的经典代表作或专辑名 JAVA 什么是 算法 线程 轻量级组件 纯JAVA ? 意大利语的童话故事书。 什么是轻量级实现 バンビーノ 歌词(会日语的进 !!!) 电酱观察日记百度云 spring是轻量级还是重量级 我想开发一个java桌面的application,请问用轻量级组件好还是用重量级组件好? java中的顶级容器?轻量组件?重量组件?都是什么意思啊? java 轻量级组件和重量级组件的区别 请问java高手轻量级组件和重量级组件到底是什么意思? java的Swing是轻量级组件,轻量级组件是什么意思? 什么是轻量级组件,什么是重量级组件 绝地求生见过什么神奇的吃鸡圈? 为什么王者荣耀称为KOG? OPPO Find X2 Pro五千元的手机没有无线充电还值得入手吗? 华菱钢铁历史最高价2021年?华菱钢铁股票2021年股价预测?华菱钢铁这个股怎么涨不动? 华菱钢铁股票是什么板块?华菱钢铁如果股价翻倍?华菱钢铁股走势如何? 华菱钢铁股份实时走势?华菱钢铁股票上升分析?华菱钢铁21年新消息? 股票华菱钢铁的分析?华菱钢铁平均股价?华菱钢铁股票日涨幅? 关于金钟云 swing组件与AWT组件有什么区别 罗拉·菲比安的原创专辑介绍 java中的组件和容器是怎么回事 哪个著名的演员职业生涯从来没有在一次诬陷中幸存下来? 什么是JAVA组件? 罗拉·菲比安的LIVE音频专辑 java里的swing是什么意思,为什么取名swing 绯弹的亚里亚第十卷实体书什么时候出? swing 好用不 大佬,求Bambina作品合集,您上次留下的链接取消分享了… 100积分求DJ舞曲 swing组件的(类名)有哪些? 绯弹的亚里亚11什么时候出 swing组件中相当于awt组件中的Canvas的组件是什么? 求bambina作品合集 BOSSA NOVA歌曲推荐!!! 小野丽莎的SUL COCUZZOLO中文翻译名是什么? 电视机电源故障怎么修, 电视机不通电是什么原因?