Java Reference
In-Depth Information
LISTING B.3
The Full Text of AppInfo2.java
1: import java.awt.*;
2:
3: /** This class displays the values of three parameters:
4: * Name, Date and Version.
5: * @author <a href=”http://java21days.com/”>Rogers Cadenhead</a>
6: * @version 5.0
7: */
8: public class AppInfo2 extends javax.swing.JApplet {
9: /**
10: * @serial The programmer's name.
11: */
12: String name;
13: /**
14: * @serial The current date.
15: */
16: String date;
17: /**
18: * @serial The program's version number.
19: */
20: int version;
21:
22: /**
23: * This method describes the applet for any browsing tool that
24: * requests information from the program.
25: * @return A String describing the applet.
26: */
27: public String getAppletInfo() {
28: String response = “This applet demonstrates the “
29: + “use of the Applet's Info feature.”;
30: return response;
31: }
32:
33: /**
34: * This method describes the parameters that the applet can take
35: * for any browsing tool that requests this information.
36: * @return An array of String[] objects for each parameter.
37: */
38: public String[][] getParameterInfo() {
39: String[] p1 = { “Name”, “String”, “Programmer's name” };
40: String[] p2 = { “Date”, “String”, “Today's date” };
41: String[] p3 = { “Version”, “int”, “Version number” };
42: String[][] response = { p1, p2, p3 };
43: return response;
44: }
45:
46: /**
47: * This method is called when the applet is first initialized.
48: */
49: public void init() {
Search WWH ::




Custom Search