!752 concepts. static ImageSurface imageSurface; static JButton btnUpload; static JFrame frame; static JLabel lStatus; concept Title { S title; } p-awt { // << seems important concepts(); BufferedImage img = shootScreen2(); ImageSurface.verbose = true; imageSurface = new ImageSurface(img) { public void setSelection(Rectangle r) { super.setSelection(r); btnUpload.setText(r != null ? "Upload (selected area)" : "Upload"); lStatus.setText(r == null ? "" : str(new Rect(r))); } }; JPanel buttons = jcenteredline( lStatus = jlabel(), btnUpload = jbutton("Upload", r { String title = or2(uniq(Title).title, "A screenshot"); title = JOptionPane.showInputDialog(null, "Please enter screenshot title", title); if (title == null) return; BufferedImage image = imageSurface.getImage(); if (imageSurface.getSelection() != null) image = new RGBImage(image).clip(imageSurface.getSelection()).getBufferedImage(); cset(uniq(Title), +title); S id = uploadImage(title, toPNG(image)); popup("Image uploaded: " + shortSnippetLink(id)); }), jbutton("Shoot again", r { hideFrame(frame); swingLater(1000, r { imageSurface.setImage(shootScreen2()); makeFrameVisible(imageSurface); maximizeFrame(imageSurface); }); }) ); frame = showMaximizedFrame(centerAndSouth( new JScrollPane(imageSurface), buttons)); if (amFirstProgram()) hideConsole(); }