Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

argument to getHeight()

Posted on 2002-06-14
7
Medium Priority
?
220 Views
Last Modified: 2010-03-31
The definition in Image is

public abstract int getHeight(ImageObserver observer);

If I use this method in an Applet, the argument is this, such as theImage.getHeight(this);

The is no argument mismatch error, although an Applet is sent down to bind to an ImageObserver object. How does that transformation occur?
0
Comment
Question by:HanRui
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 7077876
From the javadoc for Applet:

All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

0
 
LVL 3

Expert Comment

by:msterjev
ID: 7077883
java.lang.Object
   |
   +---java.awt.Component

public abstract class Component
extends Object
implements ImageObserver, MenuContainer, Serializable

java.lang.Object
   |
   +---java.awt.Component
           |
           +---java.awt.Container
                   |
                   +---java.awt.Panel
                           |
                           +---java.applet.Applet

As you can see Applet extends Component which implements ImageObserver!
0
 

Author Comment

by:HanRui
ID: 7077938
I still need help to understand how the "this" is passed down to (ImageObserver observer). I have not seen the declaration of an interface.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Accepted Solution

by:
heyhey_ earned 400 total points
ID: 7077996
1. this -> object of class Applet (the applet)
2. Applet class implements ImageObserver interface

||
\/

this (the applet) implements ImageObserver interface
0
 
LVL 92

Expert Comment

by:objects
ID: 7079560
Strike 2 :-(
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 7083068
s..t happens ...
0
 

Author Comment

by:HanRui
ID: 7083459
Still not helpful to me. I don't understand how an interface becomes an object in the argument list declaration.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question