TBPanel () { final TBPanel testTB = new TBPanel("test"); testTB.addSpacing(true); final TBItemScrubber scrubber = testTB.addScrubber(); final int size = 130; for (int c = 0; c < size; ++c) { String txt = String.format("%d[%1.2f]", c, Math.random()); int finalC = c; Runnable action = () -> System.out.println("performed action of scrubber item at index " + finalC + " [thread:" + Thread.currentThread() + "]"); if (c == 11) { txt = "very very long text"; } else if (c == 1) { txt = "show"; action = ()->SwingUtilities.invokeLater(()->{ ourVisible = !ourVisible; NST.showScrubberItem(scrubber.myNativePeer, _makeRandomCollection(size - 1), ourVisible, false); }); } else if (c == 2) { txt = "enable"; action = ()->SwingUtilities.invokeLater(()->{ ourEnabled = !ourEnabled; NST.enableScrubberItems(scrubber.myNativePeer, _makeRandomCollection(size - 1), ourEnabled); }); } scrubber.addItem(ourTestIcon, txt, action); } return testTB; }