!7 static DynamicVStack buttons; static Set loadedButtons /*= new HashSet; */ = weakIdentityHashSet(); p-subst-autoupdate { buttons = showNiceVerticalButtons(); refresh(); addButtonsToWindow(buttons, "Refresh", f-thread refresh); } svoid refresh { if (replaceNiceButtons(buttons, filesForNiceButtons(sortFilesByDate(listPNGFiles(userDesktopDir()))))) { centerPackFrame(buttons); scrollPaneOnScroll(enclosingScrollPane(buttons), r { for (JButton b : (L) (L) stackElementsShowing(buttons)) { //if (add(loadedButtons, b)) { // will strangely not work if (!add_byContains(loadedButtons, b)) { print("Loading: " + identityHashCode(b) + " / " + getText(b)); print("Size: " + l(loadedButtons)); } } }); } }