Example #1
0
 /**
  * Set the window size to w-by-h pixels. This method must be called before any other commands.
  *
  * @param w the width as a number of pixels
  * @param h the height as a number of pixels
  * @throws a IllegalArgumentException if the width or height is 0 or negative
  */
 public static void setCanvasSize(int w, int h) {
   if (w < 1 || h < 1) throw new IllegalArgumentException("width and height must be positive");
   width = w;
   height = h;
   init();
 }
Example #2
0
 // static initializer
 static {
   init();
 }