question: private void updateCellWidths ( ) { int oldCellWidth = cellWidth ; cellWidth = RHS_BORDER_WIDTH ; if ( textArea != null ) { Font font = getFont ( ) ; if ( font != null ) { FontMetrics fontMetrics = getFontMetrics ( font ) ; int count = 0 ; int lineCount = textArea . getLineCount ( ) ; while ( lineCount >= 10 ) { lineCount = lineCount / 10 ; count ++ ; } cellWidth += fontMetrics . charWidth ( '9' ) * ( count + 1 ) + 5 ; } } if ( cellWidth != oldCellWidth ) { revalidate ( ) ; } }
target:  Changes the width of the cells in the JList so you can see every digit of each.