void (ComponentEvent e) { myItemsPerRow = (getWidth() - JBUIScale.scale(HORIZONTAL_PADDING) * 2 + myCellGaps.width) / (myCellSize.width + myCellGaps.width); myCurrentPanel.updateLayout(getWidth()); setViewportView(myCurrentPanel); }