也就是说,我现在要用什么来做ImageObserver,快帮帮我,各位
解决方案 »
- JAVA中学习GUI重要吗?
- 请大家推荐几款“问题管理系统”
- 该怎么看源代码才有效
- 关于JAVA控制台分页问题
- 学校有个比赛..想问问大家可以用Java做个什么样的程序参加比赛比较好??
- 同步异步是指线程同步!异步................?以及相关的问题啊
- 关于连接池的问题
- Exception in thread "main" java.lang.NoClassDefFoundError: hw
- 请教 阳历换算成阴历的算法 (最好有原码,不胜感激)
- 我很想学JAVA,但我是菜鸟,请问各位大虾,能推荐些好书吗?
- Java的中文读写问题,有请各位了。
- 那位高手知道怎样生成PDF格式的文件啊?
Component类实现了ImageObserver这个接口,
比如在Applet里画图,直接把Applet对象作为ImageObserver参数即可
JButton jb = new JButton("asdf",img);
我是要对JButton的paintComponent方法进行重写,所以要使用到drawImage
并不是你所想象的那样的意思。谢谢
{
g.drawImage(img,0, 0, null) ;
}
现在,我不值到该怎样用ImageObserver
Parameters
image
the Image for which to prepare a screen representation.
observer
the ImageObserver object to be notified as the image is being prepared.
Returns
true if the image has already been fully prepared; false otherwise.
Description
Prepares an image for rendering on this component. The image data is downloaded asynchronously in another thread and the appropriate screen representation of the image is generated.