srecord noeq JFilePathButton(File file) is Swingable { transient JButton button; cachedVisualize { if (button == null) { button = jimageButtonScaledToWidth(16, #1101292, "", l0 showInExplorer); componentPopupMenuItem(button, "Copy path", -> copyToClipboard(f2s(file))); } updateToolTip(); ret button; } void showInExplorer { thread { File dirToShow = isFile(file) ? dirOfFile(file) : file; //startPlatformFileManager(dirToShow); desktopOpen(dirToShow); } } void setFile(File file) { this.file = file; updateToolTip(); } void updateToolTip { setEnabled(button, file != null); toolTip(file == null ? "No file" : f2s(file) + " [click to show in file explorer]", button); } }