问题描述
任何人都可以在小白的方式有什么不同的是betweeen向我解释的ImageIcon 和图片类/ Java中的对象?谢谢
Could anyone explain to me in noob way what the difference is betweeen ImageIcon and Image classes/objects in Java? Thanks
推荐答案
它们的性质和应用是不同的。 是所有类的抽象超类的再present图形图像。 是<$ C $的实现C>图标使用图像界面
作为其源。
Their nature and application is different. Image is an abstract superclass of all classes that represent graphical images. ImageIcon is an implementation of Icon
interface that uses Image
as its source.
编辑:想想一个图片
中作为东西能的渲染和的ImageIcon
作为的将会的呈现为图标
时,其的paintIcon()
方法调用。
Think of an Image
as something that could be rendered and an ImageIcon
as something that will be rendered as an Icon
when its paintIcon()
method is called.
编辑:上面的链接将带你到JDK 6 API。这些链接将带您到JDK 8 API:和。
The links above will take you to the JDK 6 api. These links will take you to the JDK 8 api: Image and ImageIcon.
这篇关于Java的:ImageIcon的图像对比差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!