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