26.07.2013 Views

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6 Methods 299<br />

• The applet’s init method is called once by the applet container when an applet is loaded for execution.<br />

It performs initialization of an applet. The applet’s start method is called after the<br />

init method completes execution and every time the user of the browser returns <strong>to</strong> the HTML<br />

page on which the applet resides (after browsing another HTML page).<br />

• The applet’s paint method is called after the init method completes execution and the start<br />

method has started executing <strong>to</strong> draw on the applet. It is also called every time the applet needs <strong>to</strong><br />

be repainted.<br />

• The applet’s s<strong>to</strong>p method is called when the applet should suspend execution—normally, when<br />

the user of the browser leaves the HTML page on which the applet resides.<br />

• The applet’s destroy method is called when the applet is being removed from memory—normally,<br />

when the user of the browser exits the browsing session.<br />

• Method repaint can be called in an applet <strong>to</strong> cause a fresh call <strong>to</strong> paint. Method repaint<br />

invokes another method called update and passes it the Graphics object. The update method<br />

invokes the paint method and passes it the Graphics object.<br />

TERMINOLOGY<br />

ActionEvent class Math class methods<br />

ActionListener interface Math.E<br />

actionPerformed method Math.PI<br />

argument in a method call Math.random method<br />

au<strong>to</strong>matic duration method<br />

au<strong>to</strong>matic variable method call<br />

base case in recursion method-call opera<strong>to</strong>r, ()<br />

block method declaration<br />

block scope method definition<br />

call a method method overloading<br />

called method mixed-type expression<br />

caller modular program<br />

calling method named constant<br />

class overloading<br />

class scope paint method of JApplet<br />

coercion of arguments parameter in a method definition<br />

constant variable programmer-defined method<br />

copy of a value promotion rules<br />

destroy method of JApplet random-number generation<br />

divide and conquer read-only variable<br />

duration recursion<br />

element of chance recursion step<br />

fac<strong>to</strong>rial method recursive call<br />

final recursive method<br />

FlowLayout class reference parameter<br />

init method of JApplet reference types<br />

invoke a method repaint method of JApplet<br />

iteration return<br />

<strong>Java</strong> API (<strong>Java</strong> class library) return-value type<br />

JBut<strong>to</strong>n class of package javax.swing scaling<br />

JLabel class of package javax.swing scope<br />

JTextField class of package javax.swing setLayout method of JApplet<br />

local variable shifting<br />

© Copyright 1992–2002 by Deitel & Associates, Inc. All Rights Reserved. 7/3/01

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!