!7 static int delay = 500; p-substance { final new ImageSurface is; // is.noMinimumSize = true; // now default showFrame(is); // no scroll pane print(is.getSize()); // should already be the window's inner size onResizeAndNow(is, r { print("component resized. " + is.getSize()); awtLater(is, delay, r { BufferedImage img = is.getImage(); if (img.getWidth() != is.getWidth() || img.getHeight() != is.getHeight()) is.setImage(makeImage(is.getWidth(), is.getHeight())); }); }); } static BufferedImage makeImage(final int w, final int h) { ret renderImage(w, h, func(int x, int y) { ret x < w/2 != y < h/2; }); }