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