/** * Set the window size to w-by-h pixels. * * @param w the width as a number of pixels * @param h the height as a number of pixels * @throws a RunTimeException if the width or height is 0 or negative */ public static void setCanvasSize(int w, int h) { if (w < 1 || h < 1) throw new RuntimeException("width and height must be positive"); width = w; height = h; init(); }
// static initializer static { init(); }