Сабж - интересно, как java-код будет выглядеть в теге PHP.
Код:
package example.manyballs;
import javax.microedition.lcdui.*;
public class ManyCanvas extends javax.microedition.lcdui.Canvas {
Display display;
// a set of free roaming balls
SmallBall[] balls;
int numBalls;
int width, height;
boolean paused;
static int NUM_HISTORY = 8;
long times[] = new long[NUM_HISTORY];
int times_idx;
public ManyCanvas(Display d, int maxBalls) {
display = d; // save the display
// initialize the array of balls
balls = new SmallBall[maxBalls];
width = getWidth();
height = getHeight();
// Start with one ball
balls[0] = new SmallBall(this, 0, 0, width, height-12-20);
numBalls = 1;
paused = true;
}