[4064] in java-interest
[Q] getWidth(this), why passing 'this'?
daemon@ATHENA.MIT.EDU (Edith Au)
Fri Dec 8 18:36:11 1995
To: java-interest@java.sun.com
Date: Fri, 8 Dec 1995 16:55:10 -0500 (EST)
From: Edith Au <edith@pencom.com>
Hi,
public class a extends Applet
{
Image im;
public void init()
{
try
{
im = getImage(/* an image */);
}
catch (Exception e)
{}
imWidth = im.getWidth(this);
}
}
According to the API, getWidth takes an ImageObserver object as a parameter.
'this' is an applet. The only common ancestor of Applet and imageObserver is
Object. How come 'this' can be passed as an mageObserver?
-Edith
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com