question: private void redoLayout ( ) { resultPanel . removeAll ( ) ; if ( expanded ) { int curWidth = parent . getSize ( ) . width ; int relevantWidth = SingleResultOverview . MIN_WIDTH + 25 ; int xCount = curWidth / relevantWidth ; int yCount = ( int ) Math . ceil ( ( double ) results . size ( ) / xCount ) ; resultPanel . setLayout ( new GridLayout ( yCount , xCount ) ) ; for ( SingleResultOverview overview : results ) { resultPanel . add ( overview ) ; } } revalidate ( ) ; }
target:  Removes and adds the single result blocks according to the current width.