1/**
2 * Copyright(C) 1998
3 * All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4 *
5 * Permission to use, copy, modify, and distribute this
6 * software and its documentation for EDUCATIONAL purposes
7 * and without fee is hereby granted provided that this
8 * copyright notice appears in all copies.
9 *
10 * @date : January 1, 1998.
11 * @author : Salih Yurttas.
12 */
13
14
15import java.awt.*;
16
17public class Canvas00 extends Frame {
18
19 public static void main(String[] args) {
20 Frame f = new Canvas00();
21
22 f.setSize(400,320);
23 f.show();
24 }
25
26 private static String[] cStrings = {"One",
27 "Two",
28 "Three"};
29 private static final int N = cStrings.length;
30
31 public Canvas00() {
32 Canvas c = new InnerCanvas();
33 add(c);
34 }
35
36 public class InnerCanvas extends Canvas {
37 int x=10,
38 y=20;
39
40 public void paint(Graphics g) {
41 for(int i=0; i<N; i++) {
42 g.drawString(cStrings[i],x,y);
43 y += 20;
44 }
45 }
46 }
47
48}