Index: src/main/java/common/java/awt/List.java =================================================================== --- src/main/java/common/java/awt/List.java (revision 496249) +++ src/main/java/common/java/awt/List.java (working copy) @@ -48,6 +48,8 @@ private static final long serialVersionUID = -3304312411574666869L; private final static int BORDER_SIZE = 2; + + private final static Font DEFAULT_FONT = new Font("dialog", Font.PLAIN, 12); //$NON-NLS-1$ private final AWTListenerList actionListeners = new AWTListenerList( this); @@ -1409,9 +1411,14 @@ } private Dimension getMaxCharSize(Graphics g) { - FontRenderContext frc = ((Graphics2D) g).getFontRenderContext(); - return getFont().getStringBounds("W", frc).getBounds().getSize(); //$NON-NLS-1$ + final FontRenderContext frc = ((Graphics2D) g).getFontRenderContext(); + return getListFont().getStringBounds("W", frc).getBounds().getSize(); //$NON-NLS-1$ } + + private Font getListFont() { + final Font f = getFont(); + return f == null ? DEFAULT_FONT : f; + } private void doRepaint(Rectangle r) { if (isDisplayable()) { @@ -1446,7 +1453,7 @@ @SuppressWarnings("deprecation") private Dimension getItemSize() { - FontMetrics fm = toolkit.getFontMetrics(getFont()); + FontMetrics fm = toolkit.getFontMetrics(getListFont()); int itemHeight = fm.getHeight() + 2; return new Dimension(prefWidth - 2 * BORDER_SIZE, itemHeight); }