+ Dimension sz = new BookLine(
+ BookInfo.fromSource(null, longString.toString()), true)
+ .getPreferredSize();
+ list.setFixedCellHeight((int) sz.getHeight());
+ list.setFixedCellWidth(list.getWidth());
+ } else {
+ Dimension sz = new BookBlock(
+ BookInfo.fromSource(null, longString.toString()), true)
+ .getPreferredSize();
+ list.setFixedCellHeight((int) sz.getHeight());
+ list.setFixedCellWidth((int) sz.getWidth());