!7 static S id; static ImageSurface is; static JButton btnNext; static JLabel lblText; p-noconsole { autoRestart(); next(); } svoid next { disableButton(btnNext); id = randomImageServerID(); thread { try { BufferedImage img = loadImage2_progressBar(id); bool first = is == null; S name = getSnippetTitle(id); is = showImage_centered(is, name + " - " + id, img); 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); } } }