您的位置:寻梦网首页编程乐园Java天地Core JavaJava Lecture Notes

Introduction

Content

Apply

Reflect

Extend

previous.gif
 (3087 bytes)
next.gif
 (2959 bytes)

 
 
Extend Index
Extend Page # 3

Listing of CapacityApplet.java ?version 1

// <APPLET code="CapacityApplet.class" width=275 height=200></APPLET>
// CapacityApplet - version 1
import java.applet.Applet;
import java.awt.*;
public class CapacityApplet extends Applet
  {
  // instance variables
  int capacity[] = new int[4];
  // methods
  public void init()
    { capacity[0] = 55;
     capacity[1] = 34;
     capacity[2] = 80;
     capacity[3] = 101;
    }
public void paint( Graphics g )
    {
    g.drawString("CapacityApplet", 10,10 );
    }
  } // class 
Back to top
basicline.gif (169 bytes)

RITSEC - Global Campus
Copyright © 1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg