thread.start();
setUp(true); thread.start();
	public void newGame() {		if (thread != null) {			up = false;			if (pause) {				flipPause();			}			try {				thread.join();			} catch (InterruptedException ignore) {			}		}		for (int i = 0; i < WIDTH_C + 2; i++) {			for (int j = 0; j < HEIGHT_C + 2; j++) {				if (i == 0 || j == 0 || i == WIDTH_C + 1 || j == HEIGHT_C + 1)					WORLD[i][j] = COLORS.length - 1;				else					WORLD[i][j] = 0;			}		}		requestFocus();		end = false;		score = 0;		si = si_rnd.nextInt(7);		next_si = si_rnd.nextInt(7);		bi = bi_rnd.nextInt(4);		next_bi = bi_rnd.nextInt(4);		x = 1 + bi_rnd.nextInt((WIDTH_C - DIMS[si * 4 + bi][0]));		y = 0;		thread = new Thread(new Runnable() {			public void run() {				try {					up = true;					long before, after, sleep;					stop: while (up) {						before = System.currentTimeMillis();						synchronized (Tetris.class) {							while (pause) {								try {									System.out.println("waiting");									Tetris.class.wait();									System.out.println("back from waiting");								} catch (InterruptedException ignore) {								}								if (!up)									break stop;							}						}						if (hasRoom(bi, x, y + 1)) {							y++;							repaint();						} else {							newBlock();							if (!hasRoom(bi, x, y)) {								up = false;								end = true;								repaint();							}						}						after = System.currentTimeMillis();						sleep = delay - (after - before);						sleep = sleep < 0 ? delay : sleep;						try {							Thread.sleep(sleep);						} catch (InterruptedException ignore) {						}					}				} catch (Throwable ex) {					ex.printStackTrace();				}			}		});		thread.start();	}