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();
  }
}

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 ( ) ; } }
changes the width of the cells in the jlist so you can see every digit of each .
