|
What is the meaning of the following? public void paint ( Graphics gr ) A good answer might be:The parameter is a reference to an object of type Graphics. | |
Extending the Applet ClassThe definition of Applet which the program imports provides a framework for building your applet. By itself, the class Applet does little that is visible in the web browser. (It does a great many things behind the scenes, however.) To build upon this framework, you extend the Applet class:
When you extend a class, you are making a new class by "building upon" a base class. In this example, we are defining a new class called AEHousman. The new class will have everything in it that the class Applet has. (This is called inheritance.) The class Applet has a paint method, but it does little. In our definition of AEHousman, the definition of paint replaces the one in Applet. The web browser calls the paint method when it needs to "paint" the section of the monitor screen devoted to an applet. The applets that you write will have their own paint method. | |
QUESTION 3:Pretend that the web browser has just called the paint method in the AEHousman object. The first statement (which will actually be bytecode by this time) is
What do you suppose that this does?
Click Here after you have answered the question
|