Solved

argument to getHeight()

Posted on 2002-06-14
7
205 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
  • 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 16

Accepted Solution

by:
heyhey_ earned 100 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now