sclass VolatileImageSurfaceDemo is Swingable { new Timings timings; JLabel lblTimings = jlabel(); JVolatileImageSurface surface; settable Renderable renderable = (g, w, h) -> { S mode = surface.volatileMode() ? " [vol]" : ""; timings.do("background" + mode, -> { g.setColor(Color.green); g.fillRect(0, 0, w, h); }); timings.do("circle" + mode, -> fillCircle(g, w/2, h/2, w/4, Color.blue)); }; visualize { surface = new JVolatileImageSurface(renderable); awtDoEvery(lblTimings, 1.0, -> lblTimings.setText(timings.toStringSingleLine())); ret centerAndSouthWithMargin(surface, lblTimings); } }