srecord noeq CenteredComboBoxRenderer(ListCellRenderer baseRenderer) is ListCellRenderer { settable bool centerItems; public Component getListCellRendererComponent(JList list, A value, int index, bool isSelected, bool cellHasFocus) { var c = baseRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (c cast JLabel) { if (centerItems() || index < 0) centerLabel(c); else leftAlignLabel(c); } ret c; } }