Java Reference
In-Depth Information
The class TestClass contains a total of four members, two attributes and
two methods. Two attributes are public: the attribute an_attribute and the
method a_method .
The application should produce an HTML page that looks like that shown
in Figure 8.3. It is what a web browser shows (in colour) when we process
the HTML code shown in Figure 8.4.
The title of the page, defined in the second line of Figure 8.4, is Class: fol-
lowed by the name of the class. Then we see the body of the page that spec-
ifies a cyan background colour. The heading consisting of the name of the
class is decorated with some extra attributes: the size of the font is increased
by two points, the colour of the characters will be navy (dark blue), and the
font is “Tahoma”, which is a common sans-serif font. The list of the public
members is preceded by the plain text Public members: , which is formatted in
“Arial”, navy colour and increased size. The list of public members is
presented using an increased size, green, “Courier New” font. At the bottom
of the page there is a link to the home page for the Java language. This last
line is inserted in order to provide an example of an HTML item that can be
useful when representing complex documentation.
TestClass
Public members:
int a_public_attribute
void a_method(int a_parameter)
Java © Sun
Figure 8.3 An example of HTML page. Copyright © 2005 Sun Microsystems, Inc. All rights
reserved. Reproduced by permission of Sun Microsystems, Inc.
<HTML>
<head><title>Class: TestClass</title></head>
<BODY bgcolor # "cyan" >
<H1><FONT size # " ! 2" color # "navy" face # "Tahoma" >TestClass </FONT>
</H1><FONT size # " ! 2" color # "navy" face # "Arial" >Public members:
<BR> </FONT><FONT size # " ! 2" color # "green" face # "Courier New" >
<UL>
<LI>int a_public_attribute <BR> </LI>
<LI>void a_method(int a_parameter) <BR></LI>
</UL>
</FONT>
<A href # "http://java.sun.com" >Java &copy; Sun </A>
</BODY></HTML>
Figure 8.4 An example of HTML code
Search WWH ::




Custom Search