// Some simple utilities // Raja Sooriamurthi 11/13/99 import java.awt.*; public class Util { public static int randInt (int m, int n) { return (int) (m + (Math.random() * (n-m+1))); } public static Color randColor () { int r = randInt (0,255); int g = randInt (0,255); int b = randInt (0,255); return new Color (r,g,b); } public static Point randPoint (Component cmp) { Dimension dim = cmp.getSize(); int x = randInt (0, dim.width); int y = randInt (0, dim.height); return new Point (x,y); } public static void pause (int ms) { // Pause for the specified number of milliseconds. try { Thread.sleep(ms); } catch (InterruptedException e) { } } }