!7 static S id; static ImageSurface is; static JButton btnNext; p-subst { next(); } svoid next { disableButton(btnNext); id = randomImageServerID(); thread { try { BufferedImage img = loadImage2_progressBar(id); bool first = is == null; is = showImage_pack(is, img, getSnippetTitle(id) + " - " + id); if (first) addToWindow_pack(is, withTopMargin(jcenteredline(btnNext = jbutton("Next image", f next)))); centerFrame(is); } finally { enableButton(btnNext); } } }