sclass G22DBFileBrowser { G22Utils g22utils; File dir; JObjectTable table; FileWatchService dirWatcher; ReliableSingleThread rstUpdate = rstWithPreDelay(0.5, r _updateTable); *(G22Utils *g22utils) { dir = g22utils.concepts.conceptsDir(); } cachedVisualize { table = swing(-> new JObjectTable); table.itemToMap = file -> litorderedmap( "Path" := nameRelativeToPhysicalSubdirectory(dirOfFile(file), dir), "Name" := fileName(file), "Size" := file.isDirectory() ? "Directory" : str_toK(fileSize(file)) ); var tbl = table.visualize(); bindToComponent(tbl, -> { dirWatcher = new FileWatchService; dirWatcher.addRecursiveListener(dir, f -> rstUpdate!); rstUpdate!; }, -> { dispose dirWatcher; }); ret withTopAndBottomMargin(jCenteredRaisedSection("Files in Project", northAndCenterWithMargins( withLabel("Project directory:", swing(-> new JFilePathLabel(dir).visualize())), tbl ) )); } void _updateTable { table.setData_force(findAllFiles(dir)); } }