From d8a735e1b1fc632df646e7ab393ff01904736449 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Thu, 13 Sep 2018 15:49:42 -0400 Subject: [PATCH] Improve render speed of lists. --- .../java/com/lyndir/masterpassword/gui/util/Components.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Components.java b/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Components.java index 662f768f..662c983e 100644 --- a/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Components.java +++ b/platform-independent/java/gui/src/main/java/com/lyndir/masterpassword/gui/util/Components.java @@ -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) model).registerList( this );