!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)) { if (!contains(loadedButtons, b)) { loadedButtons.add(b); print("Loading: " + identityHashCode(b) + " / " + getText(b)); print("Size: " + l(loadedButtons)); } } }); } }