sclass JFileDropTarget is Swingable { settable S msg = "Drop file here"; // currently dropped file settable File file; SingleComponentPanel scp = scp(); cachedVisualize { if (!scp.hasComponent()) scp.setComponent(makeComponent()); } JComponent makeComponent() { ret file == null ? noFileComponent() : componentForFile(msg); } JComponent noFileComponent() { ret jcenteredlabel(msg); } swappable JComponent componentForFile(File file) { ret jfullcenter(jFilePathLabel(file)); } }