KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sample > evolve > WebPage


1 package sample.evolve;
2
3 import java.io.*;
4 import java.util.*;
5
6 /**
7  * Updatable class. DemoServer instantiates this class and calls
8  * show() on the created object.
9  */

10
11 // WebPage.class.0
12
public class WebPage {
13     public void show(OutputStreamWriter out) throws IOException {
14     Calendar c = new GregorianCalendar();
15     out.write(c.getTime().toString());
16     out.write("<P><A HREF=\"demo.html\">Return to the home page.</A>");
17     }
18 }
19 /*
20 // WebPage.class.1
21 public class WebPage {
22     public void show(OutputStreamWriter out) throws IOException {
23     out.write("<H2>Current Time:</H2>");
24     Calendar c = new GregorianCalendar();
25     out.write("<CENTER><H3><FONT color=\"blue\">");
26     out.write(c.getTime().toString());
27     out.write("</FONT></H3></CENTER><HR>");
28     out.write("<P><A HREF=\"demo.html\">Return to the home page.</A>");
29     }
30 }
31 */

32
Popular Tags