2
0

Improve render speed of lists.

This commit is contained in:
Maarten Billemont 2018-09-13 15:49:42 -04:00
parent a1eee88a54
commit d8a735e1b1

View File

@ -243,6 +243,9 @@ public abstract class Components {
return this;
}
} );
Dimension cellSize = getCellRenderer().getListCellRendererComponent( this, null, 0, false, false ).getPreferredSize();
setFixedCellWidth( cellSize.width );
setFixedCellHeight( cellSize.height );
if (model instanceof CollectionListModel)
((CollectionListModel<E>) model).registerList( this );